From f59d2835948e7522b17922687053a355fb35603e Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Thu, 30 Oct 2025 15:48:19 -0700 Subject: [PATCH 1/3] pre 0.9.3 --- CHANGELOG.md | 48 +++++++++++++++++++ examples/client-v2/pom.xml | 2 +- examples/client/pom.xml | 4 +- .../demo-kotlin-service/gradle.properties | 2 +- examples/demo-service/gradle.properties | 2 +- examples/jdbc/pom.xml | 2 +- .../pom.xml | 2 +- performance/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 57 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f0aea3a..f4e50c7ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,51 @@ +## 0.9.3 + +### Important Changes +- [jdbc-v2] SQL parser from v1 is ported to v2 to address multiple issues with SQL parsing. The new parser is +still an option and will be developed further. To use it set `com.clickhouse.jdbc.DriverProperties#SQL_PARSER` to `ANTLR4`. + (https://github.com/ClickHouse/clickhouse-java/pull/2579). This fixes issue: + - https://github.com/ClickHouse/clickhouse-java/issues/2574 + - https://github.com/ClickHouse/clickhouse-java/issues/2568 + - https://github.com/ClickHouse/clickhouse-java/issues/2537 + - https://github.com/ClickHouse/clickhouse-java/issues/2595 + - https://github.com/ClickHouse/clickhouse-java/issues/2617 + - https://github.com/ClickHouse/clickhouse-java/issues/2569 + - https://github.com/ClickHouse/clickhouse-java/issues/2570 + - https://github.com/ClickHouse/clickhouse-java/issues/2571 + - https://github.com/ClickHouse/clickhouse-java/issues/2572 + - https://github.com/ClickHouse/clickhouse-java/issues/2573 + - https://github.com/ClickHouse/clickhouse-java/issues/2609 + +- [repo] New artifact `clickhouse-jdbc-all` added to address issue when maven package qualifiers may not be used. +This artifact should is a copy of `clickhouse-jdbc:all` but should be used only when required. (https://github.com/ClickHouse/clickhouse-java/issues/2625) + +### Improvements +- [client-v2] Added `getShortArray()` and `getStringArray()` to `ClickHouseBinaryFormatReader`. (https://github.com/ClickHouse/clickhouse-java/pull/2604) +- [client-v2] Added `result_rows` and `elapsed_time` to summary object. (https://github.com/ClickHouse/clickhouse-java/pull/1633/files) + +### Bug Fixes +- [jdbc-v2] Fixed issue with `maxRows` in `Statement` when additional settings were used to limit result set size. +It caused problems with read-only users because such users may not change settings in most cases. Now when `maxRows` is +set then `ResultSet` will skip extra rows. (https://github.com/ClickHouse/clickhouse-java/issues/2582) +- [jdbc-v2] Fixed issue with driver version. Previously version of a library was converted to minor and major version. +But this approach doesn't work well with `0.9.x` versions. Now major and minor versions are combined by shifting major. +Patch version becomes a minor version. (https://github.com/ClickHouse/clickhouse-java/issues/2410) +- [jdbc-v2, client-v2] Fixed converting different data types to a string. For example, there was an issue with IP +address when `toString()` was used and returned `\0.0.0.0` instead of `0.0.0.0`. (https://github.com/ClickHouse/clickhouse-java/issues/2575) +- [jdbc-v2] Fixed issues around spatial data (GEO types). (https://github.com/ClickHouse/clickhouse-java/issues/2577) +- [client-v2] Fixed issue with current user name. If user name is set then it will be used event after reading +server context. (https://github.com/ClickHouse/clickhouse-java/issues/2247) +- [client-v2] Fixed issue with network timeout settings when default value failed to be cast to Long. (https://github.com/ClickHouse/clickhouse-java/issues/2597) +- [jdbc-v2] Fixed getting metadata for nullable columns. (https://github.com/ClickHouse/clickhouse-java/issues/2586) +- [jdbc-v2, client-v2] Fixed issues related to reading JSON data type. Fixed reading JSON columns with arrays. Previously was causing exceptions like +`com.clickhouse.client.api.ClientException: Unsupported data type with tag 101 at ...` +(https://github.com/ClickHouse/clickhouse-java/issues/2598, https://github.com/ClickHouse/clickhouse-java/issues/2593, + https://github.com/ClickHouse/clickhouse-java/issues/2613, https://github.com/ClickHouse/clickhouse-java/issues/2102) +- [client-v2] Fixed configuration parameter type for `socket_linger` to match documentation. (https://github.com/ClickHouse/clickhouse-java/issues/2524) +- [client-v2] Fixed handling exceptions in http client code. Now response object is always closed to prevent connection leaking. (https://github.com/ClickHouse/clickhouse-java/pull/2615) +- [jdbc-v2, client-v2] Fixed issue with duplicate column names in a result set. (https://github.com/ClickHouse/clickhouse-java/issues/2459, https://github.com/ClickHouse/clickhouse-java/issues/2336) +- [jdbc-v2] Fixed ANTLR4 parse issue with `filter` clause along with aggregate function. (https://github.com/ClickHouse/clickhouse-java/pull/2631) + ## 0.9.2 ### Improvements diff --git a/examples/client-v2/pom.xml b/examples/client-v2/pom.xml index b97b62726..6321b8afb 100644 --- a/examples/client-v2/pom.xml +++ b/examples/client-v2/pom.xml @@ -54,7 +54,7 @@ UTF-8 UTF-8 - 0.9.2-SNAPSHOT + 0.9.3-SNAPSHOT 3.8.1 diff --git a/examples/client/pom.xml b/examples/client/pom.xml index 4f7a0b06b..1c7f04fd2 100644 --- a/examples/client/pom.xml +++ b/examples/client/pom.xml @@ -40,9 +40,9 @@ UTF-8 UTF-8 - 0.9.2-SNAPSHOT + 0.9.3-SNAPSHOT - + 5.2.1 diff --git a/examples/demo-kotlin-service/gradle.properties b/examples/demo-kotlin-service/gradle.properties index bd28861fc..f8c65ddd3 100644 --- a/examples/demo-kotlin-service/gradle.properties +++ b/examples/demo-kotlin-service/gradle.properties @@ -3,4 +3,4 @@ ktor_version=2.3.12 kotlin_version=2.0.20 logback_version=1.4.14 -ch_java_client_version=0.9.2 \ No newline at end of file +ch_java_client_version=0.9.3 \ No newline at end of file diff --git a/examples/demo-service/gradle.properties b/examples/demo-service/gradle.properties index 37958e9d4..b5457344c 100644 --- a/examples/demo-service/gradle.properties +++ b/examples/demo-service/gradle.properties @@ -1,2 +1,2 @@ -ch_java_client_version=0.9.2 \ No newline at end of file +ch_java_client_version=0.9.3 \ No newline at end of file diff --git a/examples/jdbc/pom.xml b/examples/jdbc/pom.xml index f64365ebd..ceffac850 100644 --- a/examples/jdbc/pom.xml +++ b/examples/jdbc/pom.xml @@ -54,7 +54,7 @@ UTF-8 UTF-8 - 0.9.2-SNAPSHOT + 0.9.3-SNAPSHOT 4.0.3 5.2.1 diff --git a/examples/r2dbc/clickhouse-r2dbc-spring-webflux-sample/pom.xml b/examples/r2dbc/clickhouse-r2dbc-spring-webflux-sample/pom.xml index a0b03bb8c..3ecea8936 100644 --- a/examples/r2dbc/clickhouse-r2dbc-spring-webflux-sample/pom.xml +++ b/examples/r2dbc/clickhouse-r2dbc-spring-webflux-sample/pom.xml @@ -14,7 +14,7 @@ 1.8 1.8 - 0.9.2-SNAPSHOT + 0.9.3-SNAPSHOT 2.7.18 diff --git a/performance/pom.xml b/performance/pom.xml index f599258ce..6303446a5 100644 --- a/performance/pom.xml +++ b/performance/pom.xml @@ -15,7 +15,7 @@ 5.3.1 2.0.17 - 0.9.2-SNAPSHOT + 0.9.3-SNAPSHOT 1.37 1.20.6 diff --git a/pom.xml b/pom.xml index 31729af8b..a01498716 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ - 0.9.2-SNAPSHOT + 0.9.3-SNAPSHOT 2025 UTF-8 UTF-8 From a74787925856227317c8438fcdec9e2cf27654c7 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Fri, 31 Oct 2025 07:10:00 -0700 Subject: [PATCH 2/3] added more information about parsers --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e50c7ce..44337d01a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ ## 0.9.3 ### Important Changes -- [jdbc-v2] SQL parser from v1 is ported to v2 to address multiple issues with SQL parsing. The new parser is -still an option and will be developed further. To use it set `com.clickhouse.jdbc.DriverProperties#SQL_PARSER` to `ANTLR4`. +- [jdbc-v2] SQL parser from v1 is ported to v2 to address multiple issues with SQL parsing. The ANTLR4-based parser is +still an option and will be developed further. The main difference between parses is completeness of their grammar: +JavaCC grabs only needed information and skips parsing of the rest (what makes it work for most cases) while ANTLR4 +has more complete grammar and can detect type of some complex statements more accurate than JavaCC. +To use it set `com.clickhouse.jdbc.DriverProperties#SQL_PARSER` to `ANTLR4`. (https://github.com/ClickHouse/clickhouse-java/pull/2579). This fixes issue: - https://github.com/ClickHouse/clickhouse-java/issues/2574 - https://github.com/ClickHouse/clickhouse-java/issues/2568 From b0b75f08520cb8cbdc262ed2cc60ed211d1e5578 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Fri, 31 Oct 2025 13:40:49 -0700 Subject: [PATCH 3/3] fixed small parser issue in ANTLR4 --- CHANGELOG.md | 1 + .../clickhouse/jdbc/internal/parser/antlr4/ClickHouseParser.g4 | 3 +++ .../com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44337d01a..a72806204 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ To use it set `com.clickhouse.jdbc.DriverProperties#SQL_PARSER` to `ANTLR4`. - https://github.com/ClickHouse/clickhouse-java/issues/2572 - https://github.com/ClickHouse/clickhouse-java/issues/2573 - https://github.com/ClickHouse/clickhouse-java/issues/2609 + - https://github.com/ClickHouse/clickhouse-java/issues/2527 - [repo] New artifact `clickhouse-jdbc-all` added to address issue when maven package qualifiers may not be used. This artifact should is a copy of `clickhouse-jdbc:all` but should be used only when required. (https://github.com/ClickHouse/clickhouse-java/issues/2625) diff --git a/jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/parser/antlr4/ClickHouseParser.g4 b/jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/parser/antlr4/ClickHouseParser.g4 index ced2d4a89..82c2b6cab 100644 --- a/jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/parser/antlr4/ClickHouseParser.g4 +++ b/jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/parser/antlr4/ClickHouseParser.g4 @@ -1369,6 +1369,7 @@ keyword | SHOW | SOURCE | START + | STATISTICS | STOP | SUBSTRING | SYNC @@ -1439,6 +1440,8 @@ keywordForAlias | MINUTE | SECOND | REVOKE + | URL + | STATISTICS ; alias diff --git a/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java b/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java index a982a76e6..f4f0d6556 100644 --- a/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java +++ b/jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java @@ -581,6 +581,8 @@ public static Object[][] testStatementWithoutResultSetDP() { {"CREATE QUOTA qB FOR INTERVAL 30 minute MAX execution_time = 0.5, FOR INTERVAL 5 quarter MAX queries = 321, errors = 10 TO default", 0, false}, {"CREATE SETTINGS PROFILE max_memory_usage_profile SETTINGS max_memory_usage = 100000001 MIN 90000000 MAX 110000000 TO robin", 0, false}, {"CREATE NAMED COLLECTION foobar AS a = '1', b = '2' OVERRIDABLE", 0, false}, + {"CREATE TABLE IF NOT EXISTS statistics.vast_event_v2 (ip UInt32, url String) ENGINE = ReplacingMergeTree()", 0, false}, + {"CREATE TABLE IF NOT EXISTS `statistics`.vast_event_v2 (ip UInt32, url String) ENGINE = ReplacingMergeTree()", 0, false}, {"alter table t2 alter column v type Int32", 0, false}, {"alter table t alter column j default 1", 0, false}, {"ALTER TABLE t MODIFY COLUMN j default 1", 0, false},