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
{{ message }}
Repository navigation
Reading an array date value as LocalDate fails, same for other temporal types #3284
Reading an array value with conversion to another class fails, though the same conversion works for non-array values.
Steps to reproduce
Create a MergeTree table with Array(Nullable(Date32)) and/or Array(Nullable(DateTime64)) and/or Array(Nullable(Time64)), add some values
Query the table and read the array values as a ResultSet:
try (ResultSettrs = query.getResultSet() {
trs.next();
Arrayarray = rs.getArray(columnIndex);
ResultSetars = array.getResultSet()) {
while (ars.next()) {
Objectvalue = ars.getObject(2, LocalDate.class);
// or LocalDateTime.class for DateTime64, // or LocalTime.class for Time64
}
}
getObject() fails
Error Log or Exception StackTrace
java.sql.SQLException: Value of class java.sql.Date cannot be converted to class java.time.LocalDate
at com.clickhouse.jdbc.types.ArrayResultSet.convertValue(ArrayResultSet.java:146)
at com.clickhouse.jdbc.types.ArrayResultSet.getValueAsObject(ArrayResultSet.java:168)
at com.clickhouse.jdbc.types.ArrayResultSet.getObject(ArrayResultSet.java:1254)
Expected Behaviour
The same conversion works for row ResultSet, so I think it should work for array result sets as well.
I believe the cause is that for array conversions, com.clickhouse.client.api.data_formats.internal.ValueConverters class is used, and it does not have Date->LocalDate / Time -> LocalTime / Timestamp -> LocalDateTime conversions.
Code Example
see above
Configuration
Client Configuration
?
Environment
Cloud
Client version: JDBC driver version 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
I also add that storing array time value as java.sql.Time means it gets rounded to milliseconds, while Time64 type is expected to be precise up to nanoseconds.
Activity
anesterenok commentedon Nov 2, 2026
I also add that storing array time value as
java.sql.Timemeans it gets rounded to milliseconds, whileTime64type is expected to be precise up to nanoseconds.