Release v0.9.7
Important Notes
- Behavior of
Client.Builder.addEndpoint(String)was changed: now it saves URL base path (more in #2344). Previously this method was ignoring base path. Please pay attention that this method still ignores query parameters. Endpoint is NOT like JDBC URL. Client has designated builder method to set configuration.
Breaking Changes
-
[client-v2]
Client.Builder#build()now throwsClientMisconfigurationExceptionwhen an unknown configuration property is passed. Previously, unknown properties were silently ignored what caused unexpected behaviour and problems. To restore the old behavior, addignore_unknown_config_key=trueto the client properties. JDBC driver-only properties (e.g.ssl) are no longer forwarded to the underlying client. (#2658) -
[client-v2]
Date/Date32columns are now decoded asLocalDatewithout any timezone adjustment. Previously,Datevalues could be returned asZonedDateTime. Applications that need aZonedDateTimemust construct it from the returnedLocalDateusing their own timezone context. More read about it - https://clickhouse.com/docs/integrations/language-clients/java/jdbc_date_time_guide (#2727)
Improvements
-
[client-v2] Added option to send query parameters in the HTTP request body using multipart form encoding. Enabled via the new
client.http.use_form_request_for_queryconfiguration property (orClient.Builder#useHttpFormDataForQuery()). Useful when query parameters would exceed URL length limits. (#2324) -
[client-v2]
QueryResponse,InsertResponse, andCommandResponsenow exposegetServerDisplayName()to retrieve the value of theX-ClickHouse-Server-Display-NameHTTP response header. A full map of whitelisted response headers is accessible viagetResponseHeaders(). (#2347) -
[client-v2] Added
getObjectArray()toClickHouseBinaryFormatReaderandGenericRecordto readArray(...)columns asObject[], including recursive support for nested arrays.getStringArray()now also handlesArray(Enum*)by returning enum names. (#2738) -
[jdbc-v2] Added support for reading and writing
byte[]forString/FixedStringcolumns.PreparedStatement#setBytes()encodes the value as a ClickHouseunhex()expression to preserve raw bytes;ResultSet#getBytes()returns the UTF-8 bytes of the string value. (#2734) -
[client-v2] Preserve path part from URL passed to builder method `addEndpoint() (#2691)
Date and Time Handling
-
[docs] Added a document that explains how driver handles different date/time values.
-
[client-v2, jdbc-v2] Fixed writing
Date/Time/Timestampvalues so that timezone conversions are performed explicitly. Previously, timezone-naïve encoding caused day-shift and precision bugs, especially when aCalendaror non-default JVM timezone was in use. (#2701, #2065, #2496, #1220, #1117, #1048, #2381, #1735, #2542, #2557) -
[client-v2, jdbc-v2] Fixed reading
Date/Time/DateTimevalues to be consistent and correct.Date/Date32are now decoded asLocalDate(no timezone), whileTime/Time64are decoded as UTC-basedLocalDateTime. NewgetLocalTime()API added to readers forLocalTimeaccess. Reading date/time fromDynamicandVariantcolumns is also fixed. (#2727) -
[jdbc-v2]
DatabaseMetaDataImpl#getTypeInfo()now returns type information in deterministic alphabetical order, matching v1 driver behavior. (#2733)
SQL Parser (jdbc-v2)
-
[jdbc-v2] Fixed SQL parser failing to handle ClickHouse keywords used as table names or column aliases (e.g.
AS value,FROM date). Both the ANTLR4 and JavaCC parsers now maintain a list of non-reserved keywords allowed in identifier positions. Also fixed parsing ofDESCRIBE (SELECT ...),INoperator inSELECT, and bracketed array access in expressions. (#2718) -
[jdbc-v2] Updated SQL parsers to recognise new ClickHouse keywords (
ABI,ARGUMENTS,DRY,LANGUAGE,RETURNS,RUN) introduced in recent ClickHouse HEAD builds. Previously, queries using these keywords as identifiers would fail to parse. (#2761) -
[jdbc-v2] Fixed SQL parser failing on statements containing the
^(caret) operator, such astoJSONString(data.^header_index). A newCARETtoken is now recognised and allowed in dotted identifier chains. (#2768)
Array and Collection Handling
-
[jdbc-v2] Fixed
DataTypeConvertercausing NPE when converting nested arrays to strings (e.g.ResultSet#getString()on anArray(Array(...))column). The converter is now re-entrancy-safe. Previously was throwingNullPointerException. (#2723) -
[client-v2, jdbc-v2] Fixed conversion of multi-dimensional
List/array values into Java arrays. Child array dimensions are now calculated correctly from the parent depth level. Previously, convertingList<List<T>>or similar structures produced incorrect results. (#2741) -
[client-v2] Fixed binary array decoding when the first element of an array is an empty
MaporList. Previously, this caused a type mismatch error during array population. (#2499, #2657, #2703)
Bug Fixes
-
[jdbc-v2] Fixed
DatabaseMetaDataImpl#getJDBCMajorVersion()andgetJDBCMinorVersion()returning the ClickHouse driver version instead of the supported JDBC specification version. Now correctly returns4and2(JDBC 4.2). (#2736) -
[jdbc-v2] Added mapping for all known ClickHouse table engines to JDBC table types. Added
MATERIALIZED VIEWas a new table type.getTables()now correctly reports remote/external engine tables that were previously invisible. (#2664) -
[jdbc-v2] Fixed
NullPointerExceptionin JDBC type metadata for columns of typeMap,IPv4,IPv6,UUID,BFloat16,Decimal256,Geometry, allInterval*types,JSON,LowCardinality,Nullable,Variant,Dynamic, and others. Previously these types had no Java class mapping. (#2711) -
[jdbc-v2] ClickHouse server error codes are now propagated to
SQLException#getErrorCode(). Previously,SQLExceptionwas created without the vendor error code, making it impossible to distinguish error types programmatically. (#2717) -
[client-v2] Fixed
max_execution_timenot being sent correctly to the server. Previously, it was treated as a client option and ignored by ClickHouse; it is now transmitted as a server setting. (#2750) -
[client-v2] Fixed
hasValue(columnName)throwing an exception when the column name does not exist. Previously, referencing an unknown column or an out-of-range index viahasValue()would throw; it now returnsfalse. (#2755) -
[jdbc-v2] Fixed
PreparedStatementreporting missing parameters using 0-based indices in the error message. JDBC parameter positions are 1-based; the error message now reflects this correctly. (#2749) -
[jdbc-v2] Ported legacy JDBC v1 connection properties (
CUSTOM_HTTP_PARAMS,CUSTOM_SETTINGS,HTTP_CONNECTION_PROVIDER,REMEMBER_LAST_SET_ROLES,USE_SERVER_TIME_ZONE_FOR_DATES) to JDBC v2. Required for integrations that share JDBC v1/v2 configuration code.custom_http_paramsandcustom_settingsvalues are converted to server settings automatically. (#2757) -
[client-v2, jdbc-v2] Fixed
custom_-prefixed configuration properties not being forwarded to the server as custom settings when using thecustom_prefix. Also fixed driver-only properties (e.g.ssl) being incorrectly forwarded to the HTTP client. (#2658)