gocql icon indicating copy to clipboard operation
gocql copied to clipboard

support for Statement request size

Open tarzanek opened this issue 5 years ago • 2 comments

Java driver has requestSizeInBytes to give a higher estimate of Statement size for counting the batch size https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Statement.html#requestSizeInBytes-com.datastax.driver.core.ProtocolVersion-com.datastax.driver.core.CodecRegistry-

go has only Batch::Size()

so when client wants to do exact batch splitting, it's hard to count the statement size

Could above be ported over from java to go?

Java logic is in: https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java#L203 or https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java#L185 or https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java#L307 (and similar, just query java driver tree for requestSizeInBytes)

tarzanek avatar Jul 27 '20 07:07 tarzanek

I'd say yes and it needs to be added upstream in gocql/gocql.

mmatczuk avatar Sep 22 '20 10:09 mmatczuk

https://github.com/gocql/gocql/issues/1448

Flamefork avatar Nov 17 '20 09:11 Flamefork