Releases: ClickHouse/clickhouse-java
Releases · ClickHouse/clickhouse-java
Release v0.8.5
Improvements
- [jdbc-v2] Added debug output for final SQL. (#2249)
Bug Fixes
- [client-v2] Fixed creating TableSchema for materialized views. It resolves issues with POJO serde. (#2118,
#2025) - [client-v2, jdbc-v2] Fixed handling
Nullable
insideSimpleAggregateFunction
columns. (#2110) - [jdbc-v2] Fixed problem with server info request. It is fetched now when timezone of the server is set. (#2191)
- [jdbc-v2] Fixed null response for
getIndexInfo()
. Empty Result Set is returned. (#2286) - [jdbc-v2] Fixed wrong
false
response inDataBaseMetadata.supportsBatchUpdates()
. Returnstrue
now. Please note that
no update is supported for result sets. - [jdbc-v2] Fixed handling UUID data type in PreparedStatement. (#2327)
- [jdbc-v2] Fixed unsigned integer type matching.
UInt8
,UInt16
,UInt32
,UInt64
,UInt128
,UInt256
are presented as
short
,int
,long
,BigInteger
,BigInteger
,BigInteger
correspondingly. SQLType for them isOTHER
because
JDBC (as well as Java) doesn't provide good mapping for unsigned integers. (#2333) - [jdbc-v2] Disallowed to call method from
Statement
interface onPreparedStatement
instance according to the JDBC spec. (#2339)
Release v0.8.4
Examples
- [jdbc-v2] - JPA example added. (#2301)
Bug Fixes
- [jdbc-v2] Added implementation of
ResultSetMetaData.getColumnClassName()
to return information
about class name of the value stored in a result. (#2112) - [client-v2] Fixed NPE when
Client.queryAll
used withINSERT
statement because internallycolumns
variable
was accessed and was null. (#2150) - [jdbc-v2] Fixed NPE when
ssl=true
was passed via an connection URL. (#2206) - [jdbc-v2] Fixed sending correct driver version. Problem occurs because context classloader had no access to
a resource file with versions. (#2245) - [jdbc-v2] Fixed incorrect flag for Array values when reading result set. (#2266)
- [jdbc-v2] Fixed parsing parameters in PreparedStatement for cases when '?' is within quotes or similar. (#2290)
- [jdbc-v2] Added implementation for
com.clickhouse.jdbc.PreparedStatementImpl#getMetaData
.
Complete metadata is returned only after statement execution. Partial metadata is returned before execution
of the statement. (#2292) - [jdbc-v2] Fixed
clearParameters
inPreparedStatementImpl
to correctly reset parameters array. (#2299) - [jdbc-v2] Fixed logging. (#2303)
Release v0.8.3
Improvements
- [client-v2] Support for native LZ4 compression (#2274)
Bug Fixes
- [jdbc-v2] Fixed several issues with reading database metadata in JDBC driver. (#2282)
- [jdbc-v2] Fixed settings client name in JDBC. (#2233)
- [client-v2] Fixed reading data from columns defined as
Nullable(FixedString(N))
. (#2218) - [jdbc-v2] Fixed SQL parser failure to parse SQL statement with comments (#2217)
- [client-v2] Fixed issue with excessive logging (#2201)
- [jdbc-v2] Fixed handling IP addresses (#2140)
- [jdbc] - Fixed missing LZ4 dependency in shaded package (#2275)
Release v0.8.2
Bug Fixes
[jdbc-v2] - Fixed a bug affecting JDBC insert performance. (#2165)
[client-v1] - Removed unnecessary object creation and added executor pool configuration (#2164)
Miscellaneous
[client-v1] - Deprecated the old client, though it is still available. We've not yet set a date for its removal, this more serves as a head's up.
Release v0.8.1
New Features
- [client-v2] - Added support for Variant Data Type for RowBinary format. Can be read into a POJO or using a reader.
Writing is supported only for POJO. (#2130) - [client-v2] - Added support for Dynamic Data Type for RowBinary format. Can be read into a POJO or using a reader.
Writing is supported only for POJO. (#2130) - [client-v2] - Added support for JSON Data Type for RowBinary format. Can be read into a POJO or using a reader.
Writing is supported only for POJO. (#2130) - [client-v2] - Added support for
ZonedDateTime
in POJO serde. (#2117) - [client-v2] - Added suport for micrometer metrics for Apache HTTP client connection pool. It is now possible to get metrics registered
in micrometer registry by callingcom.clickhouse.client.api.Client.Builder.registerClientMetrics(registry, groupName)
. (#1901)
Bug Fixes
- [client-v2] - Fixed
getTableSchema(tableName, databaseName)
now it doesn't ignore database name. (#2139) - [client-v2] - Fixed
returnGeneratedValues
to not throw an exception. Keep in mind that ClickHouse doesn't support
returning anything in response forINSERT
statements. This change was done just to make client usable with certain frameworks. (#2121) - [jdbc-v2] - Fixed changing database by
USE
statement. (#2137) - [jbdc-v2] - Fixed
ResultSetMetadata.getColumnClassName()
to return null instead of throwing exception. This change is done only
to allow certain frameworks work with the client. (#2112) - [jdbc-v2] - Fixed using statements with
WITH
in JDBC v2. Previously was causing NPE. (#2132) - [repo] - Fixed failing Test in Windows when attempting to locate files with reserved characters in the file path. (#2114)
Release v0.8.0
Highlights
- We've updated
ClickHouseDriver
andClickHouseDataSource
to default to using the new (jdbc-v2
) implementation of the JDBC driver. Settingclickhouse.jdbc.v1=true
will revert this change.
JDBC Changes
jdbc-v2
- Removed support for Transaction Support. Early versions of the driver only simulated transaction support, which could have unexpected results.jdbc-v2
- Removed support for Response Column Renaming.ResultSet
was mutable - for efficiency sake they're now read-onlyjdbc-v2
- Removed support for Multi-Statement SQL. Multi-statement support was only simulated, now it strictly follows 1:1jdbc-v2
- Removed support for Named Parameters. Not part of the JDBC specjdbc-v2
- Removed support for Stream-basedPreparedStatement
. Early version of the driver allowed for non-jdbc usage ofPreparedStatement
- if you desire such options, we recommend looking at client-v2.
New Features
- [client-v2, jdbc-v2] - Added support for Bearer token authentication like JWT. Now it is possible to specify encoded token while
creating a client and change while runtime usingcom.clickhouse.client.api.Client.updateBearerToken
. (#1834, #1988) - [client-v2] - Exposed connection pool metrics through Micrometer. It allows to monitor internal connection pool for number of active and leased connections. (#1901)
Bug Fixes
- [client-v2] - Fixed construction of
User-Agent
header. Prev. implementation usesclass.getPackage().getImplementationVersion()
what returns
incorrect title and version when library is shaded. New implementation uses build time information from resource files generated while build. (#2007) - [client-v2] - Fixed multiple issues with handling connectivity disruption. Socket timeout is unlimited by default. Added retry on timeout. Added more information to exception message.
Please read the issue for more details. (#1994) - [client-v2] - Client doesn't close provided executor anymore letting application close it instead. (#1956)
- [client-v2] - Removed unnecessary initialization to make startup time shorter. (#2032)
Release v0.7.2
New Components
jdbc-v2
- pre-release version of upcomingclickhouse-jdbc
replacement. Supports basic functionality, works only withclient-v2
.
More information will be available after its release
Highlights
- [repo] Added shaded packages with requires a set of dependencies. Use
all
classified forclient-v2
full package.
Useshaded-all
for old jdbc driver. - [client-v2] New Data Writer API was added. It allows to gain a control over writing data to low-level output stream.
This API makes it possible to write compressed data directly to server. Seecom.clickhouse.client.api.Client#insert(java.lang.String, com.clickhouse.client.api.DataStreamWriter, com.clickhouse.data.ClickHouseFormat, com.clickhouse.client.api.insert.InsertSettings)
(#2034)
New Features
- [client-v2] Added ability to specify client name. It means
User-Agent
will be filled with proper information (#1948) - [client-v2] Implemented statement parameters for
queryAll
andqueryRecords
API methods. (#1979) - [client-v2] Implemented string to number conversion. (#2014)
- [client-v1] Added basic auth support for proxies. Now you can specify username/password when connecting via a proxy that requires it with HttpURLConnection and Apache HttpClient.
- [client-v2] Enum columns can be read as string and number. Previously only as number. Now number matching string constant is returned when get as string. (#2028)
- [client-v2] Client will load some server context (timezone, user) right after build. (#2029)
Bug Fixes
- [jdbc] Fixed default value for
result_overflow_mode
setting. (#1932) - [client-v2] Fixed reading float/double values. Previously was prevented by incorrect overflow check. (#1954)
- [client-v2] Fixed issue with enabling client compression. Previously flag was ignore in some cases. (#1958)
- [client-v2] Fixed issue with reading
Array(UInt64)
because of incorrect class used to create internal array. (#1990) - [client-v2] Fixed ClickHouseLZ4OutputStream issue of sending empty frame when no data left in uncompressed buffer. (#1993)
- [client-v2] Fix handling
ConnectTimeoutException
in retry and wrapping logic. (#2015)
Release v0.7.1-patch1
Bug Fixes
- [JDBC] Fixed
java.lang.NoClassDefFoundError: com/clickhouse/client/internal/apache/hc/core5/http2/HttpVersionPolicy
(#1912) - [client-v2] Fixed multiple issues with error message handling. (#1906)
- [client-v2] Fixed primitive types conversion. Now client correctly handles numbers to boolean and vice-versa. (#1908)
Release v0.7.1
New Features
- [client-v2] Implemented more friendly number conversion. Now it is possible to convert smaller type to bigger one.
It is also possible to convert bigger into smaller if value fits into the range. (#1852) - [client-v2] Ported a feature that allows to remember DB roles for a client instance. See
com.clickhouse.client.api.Client#setDBRoles
for details. (#1832) - [client-v2] Ported a feature that allows adding comments to a query.
Seecom.clickhouse.client.api.insert.InsertSettings#logComment
andcom.clickhouse.client.api.query.QuerySettings#logComment
for details. (#1836) - [client-v2] Added support for SSL Authentication with client certificates. (#1837)
- [client-v2] Implemented a way to define a custom matching between a column name and a field in a POJO in
Client#register
method. (#1866) - [client-v1, client-v2] Implemented HTTP Basic authentication and made it a default auth method for HTTP interface. It
was done to address problem with passwords contianing special and UTF8 characters. New configuration option
com.clickhouse.client.http.config.ClickHouseHttpOption.USE_BASIC_AUTHENTICATION
for client v1 is added. For client v2
usecom.clickhouse.client.api.Client.Builder#useHTTPBasicAuth
method. (#1305)
Dependency Updates
- [client] Bumped org.apache.avro:avro version to 1.11.4 (#1855)
Documentation
- [client] Added links to javadoc for all classes in the README.md (#1878)
Bug Fixes
- [client-v2] Fixed deserializing nullable columns of
Nested
type (#1858) - [client-v2] Fixed dependencies needed for compression to work out of the box (#1805)
- [client-v2] Fixed dependency on SNAPSHOT component (#1853)
- [client-v2] Fixed using
scale
from a column definition when deserializing DateTime64 values (#1851) - [client-v2] Fixed applying database from insert settings (#1868)
- [client-v2] Fixed error handling from server (#1874)
- [client-v2] Fixed SerDe for SimpleAggregateFunction columns (#1876)
- [client] Fixed handling error from server in response with
200 OK
status. Happens when
send_progress_in_http_headers
is requested and query runs for a long time. (#1821) - [jdbc] Fixed incorrect error logging (#1827)
- [client-v2] Fixed handling tuples in arrays (#1882)
- [client-v2] Fixed passing
insert_duplication_token
throughInsertSettings
. (#1877)
Release v0.7.0
Deprecations
- Following deprecated components are removed:
- clickhouse-cli-client
- clickhouse-grpc-client
Important Changes
- [client-v2] New transport layer implementation is used by default. It is still possible to switch back
using old implementation by settingcom.clickhouse.client.api.Client.Builder#useNewImplementation
tofalse
. (#1847)
New Features
- [client-v2] Now there is an easy way to set custom HTTP headers globally for client and per operation.
Seecom.clickhouse.client.api.Client.Builder.httpHeader(java.lang.String, java.lang.String)
for details. (#1782) - [client-v2] Now there is a way to set any server settings globally for client and per operation.
Seecom.clickhouse.client.api.Client.Builder.serverSetting(java.lang.String, java.lang.String)
for details. (#1782) - [client-v2] Added support for writing AggregateFunction values (bitmap serialization). !! Reading is not
supported but will be added in the next release. (#1814) - [r2dbc] Defer connection creation. This allows pool to create a new instance on every subscription,
instead of always returning the same one. (#1810)
Performance Improvements
- [client-v2] Improved reading fixed length data like numbers. It is possible to configure readers to
use pre-allocated buffers to avoid memory allocation for each data row/block. Significantly reduces GC pressure.
Seecom.clickhouse.client.api.Client.Builder.allowBinaryReaderToReuseBuffers
for details. (#1816) - [client-v2] New API method introduced to read data directly to a POJO. Deserializers for POJO classes are compiled into
bytecode (with help of https://asm.ow2.io/ library) and optimized for each schema. It is great performance boost
because data is read without copying it into temporary structures. Code can be optimized by JVM while runtime as SerDe
code is implemented without reflection using JVM bytecode. Using bytecode makes handling primitive types without values boxing. (#1794,
#1826) - [client-v2] Optimized reading columns - internally data is read into map of column-values. It is done
to allow reading same column more than once. Previously map was cleared each row what caused a lot
internal objects creation. Now values are overridden because schema doesn't change between rows. (#1795)
Documentation
- [client-v2] Added example for Kotlin (#1793)
- [doc] Main documentation on official ClickHouse website is updated. Each client has its own page with detailed information now.
Added documentation for the Client V2. See https://clickhouse.com/docs/en/integrations/java.
Bug Fixes
- [client-v2] Fix for cases when missing operation metrics were causing NPE. (#1846)
- [client-v2] Fix for handling empty result by BinaryFormat readers. (#1845)
- [jdbc] Content of an artifact 'clickhouse-jdbc-{version}-all.jar' is fixed and contains all required classes from
clickhouse-client
andclickhouse-data
. (#1842) - [client-v1, jdbc] Endpoints definition parsing fixed to grub properties correctly. Now even properties with key-value
pairs are supported. (#1841, #1665)