You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ClickHouseBinaryFormatReader cannot handle values of type Array(UInt64).
Array reader logic creates result array using widerPrimitiveType field of ClickHouseDataType.UInt64 which is long.
At the same time reading a value to set into array uses readBigIntegerLE method which leads to attempt to set BigInteger into long[].
Steps to reproduce
Use click house v2 client and binary reader
Query table with Array(UInt64) column
use reader.next
Expected behaviour
Array(UInt64) column should be correctly read into java list (list of BigInteger I assume but whatever working version)
Caused by: java.lang.IllegalArgumentException: Failed to set value at index: 0 value 2193107007138251553 of class java.math.BigInteger
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$ArrayValue.set(BinaryStreamReader.java:585)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readArray(BinaryStreamReader.java:537)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readValue(BinaryStreamReader.java:209)
... 41 common frames omitted
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at java.base/java.lang.reflect.Array.set(Native Method)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$ArrayValue.set(BinaryStreamReader.java:582)
... 43 common frames omitted
Configuration
Environment
Client version: 0.7.1-patch1
Language version: jvm 21.0.1+12-LTS
The text was updated successfully, but these errors were encountered:
chernser
changed the title
Client V2 cannot read values of column type Array(UInt64) Client version 0.7.1-patch1
[client-v2] Cannot read values of column type Array(UInt64)
Dec 3, 2024
Describe the bug
ClickHouseBinaryFormatReader cannot handle values of type Array(UInt64).
Array reader logic creates result array using widerPrimitiveType field of ClickHouseDataType.UInt64 which is long.
At the same time reading a value to set into array uses readBigIntegerLE method which leads to attempt to set BigInteger into long[].
Steps to reproduce
Expected behaviour
Array(UInt64) column should be correctly read into java list (list of BigInteger I assume but whatever working version)
Code example
Error log
Caused by: java.lang.IllegalArgumentException: Failed to set value at index: 0 value 2193107007138251553 of class java.math.BigInteger
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$ArrayValue.set(BinaryStreamReader.java:585)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readArray(BinaryStreamReader.java:537)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readValue(BinaryStreamReader.java:209)
... 41 common frames omitted
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at java.base/java.lang.reflect.Array.set(Native Method)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$ArrayValue.set(BinaryStreamReader.java:582)
... 43 common frames omitted
Configuration
Environment
The text was updated successfully, but these errors were encountered: