clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

beta.row_binary_for_simple_insert fails on Uint64 values larger than long type passed as string

Open troyjcurt opened this issue 2 months ago • 3 comments

Describe your feedback

when you pass a very large number (larger than max long, but smaller than max UInt64) as a string in a simple insert, the client attempts to convert this value into a long using Long.parseLong, which will fail, as the string value is higher than the long boundary. something like BigInteger.longValue would be required for this translation.

Code example

preparedStatement.setString(1, bignumber);
preparedStatement.addBatch();

troyjcurt avatar Oct 21 '25 18:10 troyjcurt

Good day, @troyjcurt ! What version of a JDBC driver do you use? Would you please give a JDBC url and connection properties?

Thanks!

chernser avatar Oct 27 '25 13:10 chernser

The JDBC version was 0.9.2 (v2), and the connection url was: jdbc:ch://${CLICKHOUSE_HOSTNAME:localhost}:${CLICKHOUSE_PORT:8123}/${DB_NAME:database}?beta.row_binary_for_simple_insert=true

troyjcurt avatar Oct 27 '25 14:10 troyjcurt

Thank you, @troyjcurt!

this beta.row_binary_for_simple_insert=true is critical configuration parameter. We will fix it.

chernser avatar Oct 27 '25 14:10 chernser