Repository navigation
Open
Labels
Description
Description
Reading a column of type Array(Nullable(DateTime64(6, 'zone')))) fails unless all values are null.
Steps to reproduce
- Create a simple table and add two rows:
CREATE TABLE test(id Int64, col_timestamp Array(Nullable(DateTime64(6, 'UTC')))) ENGINE = MergeTree PRIMARY KEY (id);
INSERT INTO test VALUES (1, [null, null])(2, ['2026-01-01 13:34:56.780', '2025-10-20 08:32:13.678']);-
Execute
select * from testwith JDBC. -
At second
ResultSet.next()an exception is thrown.
Error Log or Exception StackTrace
...
Caused by: java.sql.SQLException: Failed to read value for column col_timestamp
at com.clickhouse.jdbc.internal.ExceptionUtils.toSqlState(ExceptionUtils.java:70)
at com.clickhouse.jdbc.internal.ExceptionUtils.toSqlState(ExceptionUtils.java:41)
at com.clickhouse.jdbc.ResultSetImpl.next(ResultSetImpl.java:156)
at example.it.jdbc.BaseJdbcDataset.scan(BaseJdbcDataset.java:82)
... 6 more
Caused by: com.clickhouse.client.api.ClientException: Failed to read value for column col_timestamp
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readValue(BinaryStreamReader.java:307)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readValue(BinaryStreamReader.java:135)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readValue(BinaryStreamReader.java:117)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readValue(BinaryStreamReader.java:101)
at com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.readRecord(AbstractBinaryFormatReader.java:195)
at com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.readNextRecord(AbstractBinaryFormatReader.java:242)
at com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.next(AbstractBinaryFormatReader.java:277)
at com.clickhouse.jdbc.ResultSetImpl.next(ResultSetImpl.java:145)
... 7 more
Caused by: java.lang.IllegalArgumentException: Failed to set value at index: 0 value 2026-01-01T13:34:56.780Z[Etc/UTC] of class java.time.ZonedDateTime when array type is class [Ljava.time.LocalDateTime;
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$ArrayValue.set(BinaryStreamReader.java:959)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readArrayItem(BinaryStreamReader.java:807)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readArray(BinaryStreamReader.java:785)
at com.clickhouse.client.api.data_formats.internal.BinaryStreamReader.readValue(BinaryStreamReader.java:282)
... 14 more
Caused by: java.lang.IllegalArgumentException: array element 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:956)
... 17 more
Expected Behaviour
No error. Executing same request from CLI client works just fine.
Code Example
see above
Configuration
Client Configuration
default
Environment
- Cloud
- Client version: driver 0.11-all
- Language version: JDK 17
- OS: Ubuntu 24
ClickHouse Server
- ClickHouse Server version: 26.10
- ClickHouse Server non-default settings, if any: none
CREATE TABLEstatements for tables involved: see above
Activity
anesterenok commentedon Nov 3, 2026
Similar error also happens when trying to read a column of type
Array(Nullable(Tuple(months Int32, days Int32, nanos Int64))):[client-v2] Type nullable arrays by the values read