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

[client-v2] No conversion between number types (ex. short to int)

Open chernser opened this issue 1 year ago • 0 comments

Describe the bug

It should be possible to get number values in different convertible types. Today it is required for application to know datatype of a column.

For example, binary format reader:

java.lang.ClassCastException: class java.lang.Short cannot be cast to class java.lang.Integer (java.lang.Short and java.lang.Integer are in module java.base of loader 'bootstrap')

	at com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.getInteger(AbstractBinaryFormatReader.java:484)

Expected behavior

Convertion between number types should be done automatically where applicable without data truncation.

chernser avatar Oct 07 '24 20:10 chernser