diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 669052292..6a76764c3 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -26,7 +26,7 @@ on: driver: description: "Driver version" required: true - default: "0.3.0-SNAPSHOT" + default: "0.3.1-SNAPSHOT" options: description: "Benchmark options" required: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8b53f233..f003027ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: version: description: "Release version" required: true - default: "0.3.0-SNAPSHOT" + default: "0.3.1-SNAPSHOT" jobs: release: diff --git a/.github/workflows/timezone.yml b/.github/workflows/timezone.yml index 78fd5f1f5..6134c5b15 100644 --- a/.github/workflows/timezone.yml +++ b/.github/workflows/timezone.yml @@ -59,4 +59,5 @@ jobs: find . -type f -name "pom.xml" -exec sed -i -e 's|.*argLine.*timezone=.*||g' '{}' \; mvn --batch-mode --update-snapshots \ -DclickhouseTimezone=${{ matrix.serverTz }} \ + -DclickhouseVersion=21.3 \ -Duser.timezone=${{ matrix.clientTz }} verify diff --git a/.gitignore b/.gitignore index 8d9675e2b..1c98dd67a 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ log/ target/ # Generated files +.flattened-pom.xml **/parser/*CharStream.java **/parser/ClickHouseSqlParser.java **/parser/ClickHouseSqlParserConstants.java diff --git a/README.md b/README.md index 3294504c7..400d8acaf 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It has support of a minimal subset of features to be usable. ru.yandex.clickhouse clickhouse-jdbc - 0.3.0 + 0.3.1 ``` @@ -24,14 +24,22 @@ additionally, if you have a few instances, you can use `BalancedClickhouseDataSo **Notice** -If your build tool can not resolve dependency: `com.github.RoaringBitmap:RoaringBitmap`, please add the JitPack repository to your build file: +To use an up-to-date version of RoaringBitmap, please update your POM with below two changes: ```xml + jitpack.io https://jitpack.io + + + + com.github.RoaringBitmap + RoaringBitmap + 0.9.10 + ``` ### Extended API diff --git a/clickhouse-benchmark/pom.xml b/clickhouse-benchmark/pom.xml index c10861b59..948a0c8cf 100644 --- a/clickhouse-benchmark/pom.xml +++ b/clickhouse-benchmark/pom.xml @@ -8,7 +8,6 @@ ${revision} - ${parent.groupId} clickhouse-benchmark ${revision} jar diff --git a/clickhouse-client/pom.xml b/clickhouse-client/pom.xml index 32b882d42..34bc27696 100644 --- a/clickhouse-client/pom.xml +++ b/clickhouse-client/pom.xml @@ -8,20 +8,90 @@ ${revision} - ${parent.groupId} clickhouse-client ${revision} jar + + 4.1.4 + + + + com.github.ben-manes.caffeine + caffeine + provided + + + com.lmax + disruptor + provided + + + dnsjava + dnsjava + provided + + + org.roaringbitmap + RoaringBitmap + provided + org.slf4j slf4j-api + + + org.slf4j + slf4j-log4j12 + test + + + org.mockito + mockito-all + test + + + com.github.tomakehurst + wiremock-jre8 + test + + + org.testcontainers + testcontainers + test + + + org.testng + testng + test + + + com.helger.maven + ph-javacc-maven-plugin + ${javacc-plugin.version} + + + jjc + generate-sources + + javacc + + + ${jdk.version} + true + tech.clickhouse.client.parser + src/main/javacc + src/main/java + + + + org.apache.maven.plugins maven-compiler-plugin @@ -31,10 +101,32 @@ true -Xlint:all - -Werror + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + env_str + 416 + false + + + diff --git a/clickhouse-grpc-client/pom.xml b/clickhouse-grpc-client/pom.xml index 41cb9243f..448301a91 100644 --- a/clickhouse-grpc-client/pom.xml +++ b/clickhouse-grpc-client/pom.xml @@ -8,14 +8,13 @@ ${revision} - ${parent.groupId} clickhouse-grpc-client ${revision} jar - ${parent.groupId} + ${project.parent.groupId} clickhouse-client ${revision} diff --git a/clickhouse-http-client/pom.xml b/clickhouse-http-client/pom.xml index a89830997..ab4a5ef77 100644 --- a/clickhouse-http-client/pom.xml +++ b/clickhouse-http-client/pom.xml @@ -8,17 +8,53 @@ ${revision} - ${parent.groupId} clickhouse-http-client ${revision} jar + + 4.5.13 + + - ${parent.groupId} + ${project.parent.groupId} clickhouse-client ${revision} + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + org.apache.httpcomponents + httpmime + ${httpclient.version} + + + + ${project.parent.groupId} + clickhouse-client + ${revision} + test-jar + test + + + org.slf4j + slf4j-log4j12 + test + + + org.testcontainers + testcontainers + test + + + org.testng + testng + test + @@ -32,10 +68,18 @@ true -Xlint:all - -Werror + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + diff --git a/clickhouse-jdbc/pom.xml b/clickhouse-jdbc/pom.xml index b57b275b0..cce77629c 100644 --- a/clickhouse-jdbc/pom.xml +++ b/clickhouse-jdbc/pom.xml @@ -50,6 +50,13 @@ + org.apache.httpcomponents httpclient @@ -73,8 +80,9 @@ jackson-databind - com.github.RoaringBitmap + org.roaringbitmap RoaringBitmap + provided org.slf4j @@ -202,10 +210,6 @@ net.jpountz ${shade.base}.jpountz - - org.roaringbitmap - ${shade.base}.bitmap - org.slf4j ${shade.base}.slf4j diff --git a/clickhouse-jdbc/src/main/javacc/ClickHouseSqlParser.jj b/clickhouse-jdbc/src/main/javacc/ClickHouseSqlParser.jj index c65c4eb3d..1f03193f7 100644 --- a/clickhouse-jdbc/src/main/javacc/ClickHouseSqlParser.jj +++ b/clickhouse-jdbc/src/main/javacc/ClickHouseSqlParser.jj @@ -127,7 +127,7 @@ public class ClickHouseSqlParser { if (DEBUG) { throw new IllegalArgumentException(e); } else { - log.warn("Failed to parse the given SQL. If you believe the SQL is valid, please feel free to open an issue on Github with the following SQL and exception attached.\n{}", sql, e); + log.warn("{}. If you believe the SQL is valid, please feel free to open an issue on Github with this warning and the following SQL attached.\n{}", e.getMessage(), sql); } } diff --git a/clickhouse-jdbc/src/test/java/ru/yandex/clickhouse/integration/ClickHouseStatementImplTest.java b/clickhouse-jdbc/src/test/java/ru/yandex/clickhouse/integration/ClickHouseStatementImplTest.java index 02ea533b1..e8203e1a2 100644 --- a/clickhouse-jdbc/src/test/java/ru/yandex/clickhouse/integration/ClickHouseStatementImplTest.java +++ b/clickhouse-jdbc/src/test/java/ru/yandex/clickhouse/integration/ClickHouseStatementImplTest.java @@ -34,6 +34,7 @@ import ru.yandex.clickhouse.ClickHouseStatement; import ru.yandex.clickhouse.settings.ClickHouseProperties; import ru.yandex.clickhouse.settings.ClickHouseQueryParam; +import ru.yandex.clickhouse.util.ClickHouseVersionNumberUtil; public class ClickHouseStatementImplTest { @@ -126,8 +127,10 @@ public void testSelectUInt64() throws SQLException { @Test public void testExternalData() throws SQLException, UnsupportedEncodingException { + String serverVersion = connection.getServerVersion(); ClickHouseStatement stmt = connection.createStatement(); - String[] rows = "21.3.3.14".equals(connection.getServerVersion()) + String[] rows = ClickHouseVersionNumberUtil.getMajorVersion(serverVersion) >= 21 + && ClickHouseVersionNumberUtil.getMinorVersion(serverVersion) >= 3 ? new String[] { "1\tGroup\n" } : new String[] { "1\tGroup", "1\tGroup\n" }; diff --git a/clickhouse-jdbc/src/test/resources/log4j.properties b/clickhouse-jdbc/src/test/resources/log4j.properties index d274cc5cc..b6c544007 100644 --- a/clickhouse-jdbc/src/test/resources/log4j.properties +++ b/clickhouse-jdbc/src/test/resources/log4j.properties @@ -1,6 +1,6 @@ -log4j.rootLogger=DEBUG, STDOUT -log4j.category.ru.yandex.clickhouse=DEBUG -log4j.logger.org.apache.http=WARN +log4j.rootLogger=WARN, STDOUT +#log4j.category.ru.yandex.clickhouse=DEBUG +#log4j.logger.org.apache.http=DEBUG log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.sss} [%t] [%-5p] {%c{1}:%L} - %m%n diff --git a/pom.xml b/pom.xml index efe899718..ad2af80c6 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT 2021 UTF-8 UTF-8 @@ -85,7 +85,7 @@ 1.7.1 2.9.10 2.9.10.8 - 0.9.9 + 0.9.3 1.7.30 1.10.19 2.27.2 @@ -93,6 +93,7 @@ 6.14.3 3.3.0 3.0.0-M1 + 1.2.7 1.6.8 1.6 3.8.1 @@ -109,10 +110,10 @@ ${skipTests} clickhouse_clickhouse-jdbc - ${artifactId} + ${project.artifactId} clickhouse https://sonarcloud.io - 0.3.0 + 0.3.1 @@ -148,7 +149,7 @@ ${lz4.version} - com.github.RoaringBitmap + org.roaringbitmap RoaringBitmap ${roaring-bitmap.version} @@ -274,8 +275,38 @@ false + + org.codehaus.mojo + flatten-maven-plugin + ${flatten-plugin.version} + + true + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + @@ -402,11 +433,13 @@ - +