Skip to content

Releases: ClickHouse/clickhouse-java

Release v0.7.0

02 Oct 06:28
a499238
Compare
Choose a tag to compare

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 setting com.clickhouse.client.api.Client.Builder#useNewImplementation to false. (#1847)

New Features

  • [client-v2] Now there is an easy way to set custom HTTP headers globally for client and per operation.
    See com.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.
    See com.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.
    See com.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
    and clickhouse-data. (#1842)
  • [client-v1, jdbc] Endpoints definition parsing fixed to grub properties correctly. Now even properties with key-value
    pairs are supported. (#1841, #1665)

Release v0.6.5

01 Sep 14:16
cbdbab0
Compare
Choose a tag to compare

Deprecations

  • Following components will be deprecated and removed in 0.7.0 release:
    • clickhouse-cli-client
    • clickhouse-grpc-client
  • Projects cli-client and grpc-client are excluded from release and build.
  • No more builds for non-lts Java versions - no more Java 9 release builds.

Performance Improvements

  • [client-v2] queryAll() optimized to use less memory (#1779)
  • [client-v2] Client.Builder#setClientNetworkBufferSize introduced to allow increasing a buffer that is used
    to transfer data from socket buffer to application memory. When set to >= of send/receive socket buffer size it
    significantly reduces number of system calls and improves performance. (#1784)

New Features

  • [client-v2] Client will retry on NoHttpResponseException when using Apache HTTP client.
    It is useful when close/stale connection is leased from connection pool. No client will
    retry one more time instead of failing. Client.Builder#retryOnFailures and Client.Builder#setMaxRetries were
    introduced to configure client behavior. (#1768)

Bug Fixes

  • [client-v2] Correct timezone used when reading DateTime values. Affects how date/datetime values
    are read when session_timezone is used (#1780)
  • [client-v2] Fix reading big integers. Previously was causing incorrect values
    (#1786)
    (#1776)
  • [client-v2] Fix server compressions when using a client instance concurrently
    (#1791)
  • [client-v2] Fix reading arrays as list. Also affected reading nested arrays (#1800)
  • [client-v1] Fix handling summary metadata for write operations. Previously was causing empty metadata

Release v0.6.4

17 Aug 04:20
fc8d92e
Compare
Choose a tag to compare

Deprecations

  • Following components will be deprecated and archived in next release:
    • clickhouse-cli-client
    • clickhouse-grpc-client
  • No more builds for non-lts Java versions - no more Java 9 release builds.
  • Lowest supported Java version will be 11.
    • Java 11 support will be ended before the end of 2023.
    • It is recommended to use Java 21.

Important Changes

  • [Client-V1] Fix for handling DateTime without timezone when session_timezone is set. Now server timezone
    is parsed from server response when present (#1464)

New Features

  • [Client-V1/Apache HTTP] More configuration parameters for connection management. Useful for tuning performance.
    (#1771)
    • com.clickhouse.client.config.ClickHouseClientOption#CONNECTION_TTL - to configure connection time-to-live
    • com.clickhouse.client.http.config.ClickHouseHttpOption#KEEP_ALIVE_TIMEOUT - to configure keep-alive timeout
    • com.clickhouse.client.http.config.ClickHouseHttpOption#CONNECTION_REUSE_STRATEGY - defines how connection pool behaves.
      If FIFO is selected then connections are reused in the order they were created. It results in even distribution of connections.
      If LIFO is selected then connections are reused as soon they are returned to the pool.
      Note: only for APACHE_HTTP_CLIENT connection provider.
    • Additionally switched to using LAX connection pool for Apache Connection Manager to improve performance
      for concurrent requests.
  • [Client-V2] Connection pool configuration #1766
    • com.clickhouse.client.api.Client.Builder.setConnectionRequestTimeout - to configure connection request timeout.
      Important when there are no connections available in the pool to fail fast.
    • com.clickhouse.client.api.Client.Builder.setMaxConnections - configures how soft limit of connections per host.
      Note: Total number of connections is unlimited because in most cases there is one host.
    • com.clickhouse.client.api.Client.Builder.setConnectionTTL - to limit connection live ignoring keep-alive from server.
    • com.clickhouse.client.api.Client.Builder.setConnectionReuseStrategy - to configure how connections are used.
      Select FIFO to reuse connections evenly or LIFO (default) to reuse the most recently active connections.
  • [Client-V2] All operations are now executed in calling thread to avoid extra threads creation.
    Async operations can be enabled by com.clickhouse.client.api.Client.Builder.useAsyncRequests (#1767)
  • [Client-V2] Content and HTTP native compression is supported now Currently only LZ4 is available. (#1761)
  • [Client-V2] HTTPS support added. Required to communicate with ClickHouse Cloud Services.
    Client certificates are supported, too. (#1753)
  • [Client-V2] Added support for HTTP proxy (#1748)

Documentation

  • [Client-V2] Spring Demo Service as usage example (#1765)
  • [Client-V2] Examples for using text based formats (#1752)

Bug Fixes

  • [Client-V2] Data is read fully from a stream. Important for Cloud instances (#1759)
  • [Client-V2] Timezone from a server response is now used to parse DateTime values (#1763)
  • [Client-V1] Timezone from a server response is now used to parse DateTime values (#1464)

Release v0.6.3

19 Jul 20:51
a6a8a22
Compare
Choose a tag to compare

Important Changes

  • [Client-V1] Changed how User-Agent string is generated. Now ClickHouse-JavaClient portion is appended in all cases.
    It is still possible to set custom product name that will be the first part in User-Agent value.
    (#1698)

New Features

  • [Client-V1/Apache HTTP] Retry on NoHttpResponseException in Apache HTTP client.
    Should be used with causes because it is not always possible to resend request body.
    Behaviour is controlled by com.clickhouse.client.http.config.ClickHouseHttpOption#AHC_RETRY_ON_FAILURE.
    Works only for Apache HTTP client because based on its specific behavior(#1721)
  • [Client-V1/Apache HTTP] Connection validation before sending request.
    Behaviour is controlled by com.clickhouse.client.http.config.ClickHouseHttpOption#AHC_VALIDATE_AFTER_INACTIVITY.
    By default, connection is validated after being in the pool for 5 seconds. (#1722)

Bug Fixes

  • [Client-V2] Fix making it possible to pass URL starting with "https://" for secure endpoints (#1718)
  • [Client-V2] Fix minimizes number of threads used by the client. It reduces resource usage significantly. (#1691)
  • [Client-V1] Fix slowness ( > 1 min) caused by incorrect localhost IP determination while initialization of the client (#1729)
  • [Client-V2] Make client instance closeable to free underlying resource (#1733)

Release v0.6.2

29 Jun 18:22
287919a
Compare
Choose a tag to compare

New Features

  • Describe non-executed SELECT queries in prepared statements to provide metadata (#1430)
  • Command execution in the client API (#1693)
  • Added com.clickhouse.client.ClickHouseResponseSummary#getQueryId() (#1636)
  • Added support for SSL for the Client V2
  • Added proxy support for Client V2 (#1694)
  • Added more examples for

Release v0.6.1

10 Jun 23:03
5be856e
Compare
Choose a tag to compare

New Features

Bug Fixes

  • Fix proper handling of ClickHouseResult to release DB connection (#1538
  • Not it is possible to get raw input stream from a server response to read data in any format by user.
  • Exception context remove from a message. Server information not present anymore but available thru com.clickhouse.client.ClickHouseException#getServer (#1677)

Release v0.6.0-patch5

26 May 15:43
067ae0b
Compare
Choose a tag to compare

Bug Fixes

  • Roles (memorized by client) can be reset with 'SET ROLE NONE' query (#1647)
  • MaxBufferSize can be greater than internal MAX value now
  • Updated example project to use the latest version of the client

Release v0.6.0-patch4

24 Apr 23:09
6a4ffc4
Compare
Choose a tag to compare

New Features

  • Added possibility to set client ID in Referer HTTP Header (#1572)
  • [HTTP] Persistence of a role after it is set by SET ROLE <role>

Bug Fixes

  • Change RowBinaryWithDefaults settings. Output is changed from true to false
  • Fix fail over for Apache HTTP client. Connect timeout error is not detected correctly
  • Fix password logging in DEBUG (#1571)
  • Fix handling "NoHttpResponseException" in Apache HTTP client
  • Fix param error in ByteUtils#equals in java9

Release v0.6.0-patch3

31 Mar 05:11
4c3e0eb
Compare
Choose a tag to compare

Bug Fixes

  • Not detecting correctly ClickHouse error code
  • Fix JDBC read error - Multidimensional empty errors raise a java.lang.ArrayStoreException

Release v0.6.0-patch2

21 Mar 15:44
be06439
Compare
Choose a tag to compare

Reason:
Vulnerability in dependencies

Dependencies update:

  • org.apache.commons:commons-compress from 1.23.0 to 1.26.1
  • org.postgresql:postgresql from 42.6.0 to 42.6.1