From aa67a79f575890e6cbedb5c408a8c09fc13ad8e8 Mon Sep 17 00:00:00 2001 From: Zhichun Wu Date: Tue, 27 Apr 2021 19:25:34 +0800 Subject: [PATCH 1/4] Add CustomSeparated for #474 and #606 --- .../main/java/ru/yandex/clickhouse/domain/ClickHouseFormat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clickhouse-jdbc/src/main/java/ru/yandex/clickhouse/domain/ClickHouseFormat.java b/clickhouse-jdbc/src/main/java/ru/yandex/clickhouse/domain/ClickHouseFormat.java index 176573e05..773914c05 100644 --- a/clickhouse-jdbc/src/main/java/ru/yandex/clickhouse/domain/ClickHouseFormat.java +++ b/clickhouse-jdbc/src/main/java/ru/yandex/clickhouse/domain/ClickHouseFormat.java @@ -13,7 +13,7 @@ * @author Dmitry Andreev */ public enum ClickHouseFormat { - + CustomSeparated, TabSeparated, TabSeparatedRaw, TabSeparatedWithNames, From 500aa981a202b104c4713898f396e07db10ae763 Mon Sep 17 00:00:00 2001 From: Zhichun Wu Date: Tue, 27 Apr 2021 20:31:24 +0800 Subject: [PATCH 2/4] Add example for use of ClickHouseProperties and ClickHouseQueryParam(#627) --- README.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 400d8acaf..b615e9ed8 100644 --- a/README.md +++ b/README.md @@ -20,28 +20,32 @@ URL syntax: JDBC Driver Class: `ru.yandex.clickhouse.ClickHouseDriver` -additionally, if you have a few instances, you can use `BalancedClickhouseDataSource`. - -**Notice** - -To use an up-to-date version of RoaringBitmap, please update your POM with below two changes: -```xml - - - - jitpack.io - https://jitpack.io - - +For example: +```java +String url = "jdbc:clickhouse://localhost:8123/test"; +ClickHouseProperties properties = new ClickHouseProperties(); +// set connection options - see more defined in ClickHouseConnectionSettings +properties.setClientName("Agent #1"); +... +// set default request options - more in ClickHouseQueryParam +properties.setSessionId("default-session-id"); +... - - - com.github.RoaringBitmap - RoaringBitmap - 0.9.10 - +ClickHouseDataSource dataSource = new ClickHouseDataSource(url, properties) +String sql = "select * from mytable"; +Map additionalDBParams = new HashMap<>(); +// set request options, which will override the default ones in ClickHouseProperties +additionalDBParams.put(ClickHouseQueryParam.SESSION_ID, "new-session-id"); +... +try (ClickHouseConnection conn = dataSource.getConnection(); + ClickHouseStatement stmt = conn.createStatement(); + ResultSet rs = stmt.executeQuery(sql, additionalDBParams)) { + ... +} ``` +Additionally, if you have a few instances, you can use `BalancedClickhouseDataSource`. + ### Extended API In order to provide non-JDBC complaint data manipulation functionality, proprietary API exists. Entry point for API is `ClickHouseStatement#write()` method. From 4fade07f757fea2276fbb8f63955a1e89ab90d87 Mon Sep 17 00:00:00 2001 From: Zhichun Wu Date: Tue, 27 Apr 2021 20:34:04 +0800 Subject: [PATCH 3/4] Bump dependency - merge PR #640 --- pom.xml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index ad2af80c6..8fe3731b0 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 1.7.1 2.9.10 2.9.10.8 - 0.9.3 + 0.9.10 1.7.30 1.10.19 2.27.2 @@ -432,14 +432,4 @@ - - From aa2dfc3ac39cbc4571287a43ed94064d00f7f2d9 Mon Sep 17 00:00:00 2001 From: Zhichun Wu Date: Tue, 27 Apr 2021 20:58:34 +0800 Subject: [PATCH 4/4] Prepare 0.3.1 release --- CHANGELOG | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 8c4ff5840..e9c0034ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,15 @@ +0.3.1 + * BREAKING CHANGE - move query from url to request body + * BREAKING CHANGE - always parse SQL(use extended API to skip that) + * BREAKING CHANGE - remove keepAliveTimeout and useNewParser from ClickHouseProperties + * BREAKING CHANGE - exclude RoaringBitmap from shaded jar + * add new connection setting useSharedCookieStore for load balancing + * add new query parameters: allow_experimental_bigint_types, allow_experimental_map_type, and join_algorithm + * add new format: CustomSeparated and RowBinaryWithNamesAndTypes + * fix 400 bad request error when dealing with large query + * fix parser issue when DESC statement contains alias + * support batch processing with arbitrary query - update and delete are not recommended so there'll be warnings + * support multi-statement sql - session will be used automatically and only the last result will be returned 0.3.0 * BREAKING CHANGE - dropped JDK 7 support * BREAKING CHANGE - removed Guava dependency(and so is UnsignedLong)