Repository navigation
Closed
Labels
bugdata-typesArea: type names, value encoding and decoding, row mapping, data formatsjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)legacyOnly the v1 stack (clickhouse-client, clickhouse-http-client, clickhouse-jdbc) has the problem
Milestone
Description
jdbc:ch:http://host:port?nullAsDefault=2
// ClickHouseDateTimeValue.class
static {
DEFAULT = ClickHouseDateValue.DEFAULT.atStartOfDay();
dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
}
// BinaryStreamUtils.class
public static void writeDateTime32(OutputStream output, LocalDateTime value, TimeZone tz) throws IOException {
long time = tz != null && !tz.equals(ClickHouseValues.UTC_TIMEZONE) ? value.atZone(tz.toZoneId()).toEpochSecond() : value.toEpochSecond(ZoneOffset.UTC);
writeUnsignedInt32(output, ClickHouseChecker.between(time, "DateTime", 0L, 4294967295000L));
}Caused by: java.lang.IllegalArgumentException: DateTime(-28800) should between 0 and 4294967295000 inclusive of both values
at com.clickhouse.client.ClickHouseChecker.newException(ClickHouseChecker.java:19) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.client.ClickHouseChecker.between(ClickHouseChecker.java:111) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.client.data.BinaryStreamUtils.writeDateTime32(BinaryStreamUtils.java:1468) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.client.data.BinaryStreamUtils.writeDateTime(BinaryStreamUtils.java:1433) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.client.data.ClickHouseRowBinaryProcessor$MappedFunctions.lambda$buildMappingsForDataTypes$53(ClickHouseRowBinaryProcessor.java:299) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.client.data.ClickHouseRowBinaryProcessor$MappedFunctions.serialize(ClickHouseRowBinaryProcessor.java:486) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.jdbc.internal.InputBasedPreparedStatement.addBatch(InputBasedPreparedStatement.java:326) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.jdbc.internal.InputBasedPreparedStatement.executeAny(InputBasedPreparedStatement.java:104) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
at com.clickhouse.jdbc.internal.InputBasedPreparedStatement.execute(InputBasedPreparedStatement.java:294) ~[clickhouse-jdbc-0.3.2-patch10-http.jar:clickhouse-jdbc 0.3.2-patch10 (revision: aebad16)]
Metadata
Metadata
Assignees
Labels
bugdata-typesArea: type names, value encoding and decoding, row mapping, data formatsjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)legacyOnly the v1 stack (clickhouse-client, clickhouse-http-client, clickhouse-jdbc) has the problem
Activity
cod-soap commentedon Feb 27, 2023
Still got this problem in version:0.3.2-patch11, When I set 0 or null timestamp to ClickHouse DataTime column,I got this err:
DateTime(-28800) should between 0 and 4294967295000 inclusive of both values