Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions clickhouse-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
<relocation>
<!-- lz4 compression -->
<pattern>net.jpountz</pattern>
<shadedPattern>${shade.base}.jpountz</shadedPattern>
<shadedPattern>${shade.base}.net.jpountz</shadedPattern>
</relocation>
<relocation>
<pattern>org.roaringbitmap</pattern>
Expand All @@ -435,12 +435,17 @@

<relocation>
<pattern>com.google</pattern>
<shadedPattern>${shade.base}.google</shadedPattern>
<shadedPattern>${shade.base}.com.google</shadedPattern>
</relocation>

<relocation>
<pattern>org.apache</pattern>
<shadedPattern>${shade.base}.apache</shadedPattern>
<shadedPattern>${shade.base}.org.apache</shadedPattern>
</relocation>

<relocation>
<pattern>org.antlr</pattern>
<shadedPattern>${shade.base}.org.antlr</shadedPattern>
</relocation>
</relocations>
<transformers>
Expand Down
1 change: 0 additions & 1 deletion client-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<url>https://github.com/ClickHouse/clickhouse-java/tree/main/client-v2</url>

<properties>
<apache.httpclient.version>5.3.1</apache.httpclient.version>
<shade.base>${project.groupId}.shaded</shade.base>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1947,14 +1947,14 @@ public void testReadingJSONValues() throws Exception {
client.execute("INSERT INTO test_json_values VALUES ('{\"a\" : {\"b\" : 42}, \"c\" : [1, 2, 3]}')", commandSettings).get(1, TimeUnit.SECONDS);


QuerySettings settings = new QuerySettings().setFormat(ClickHouseFormat.CSV);
QuerySettings settings = new QuerySettings().setFormat(ClickHouseFormat.CSV).serverSetting("output_format_json_quote_64bit_integers", "1");
try (QueryResponse resp = client.query("SELECT json FROM test_json_values", settings).get(1, TimeUnit.SECONDS)) {
BufferedReader reader = new BufferedReader(new InputStreamReader(resp.getInputStream()));
Assert.assertEquals(StringEscapeUtils.unescapeCsv(reader.lines().findFirst().get()), "{\"a\":{\"b\":\"42\"},\"c\":[\"1\",\"2\",\"3\"]}");
}

settings = new QuerySettings()
.serverSetting(ServerSettings.OUTPUT_FORMAT_BINARY_WRITE_JSON_AS_STRING, "1");
.serverSetting(ServerSettings.OUTPUT_FORMAT_BINARY_WRITE_JSON_AS_STRING, "1").serverSetting("output_format_json_quote_64bit_integers", "1");
try (QueryResponse resp = client.query("SELECT json FROM test_json_values", settings).get(1, TimeUnit.SECONDS)) {
ClickHouseBinaryFormatReader reader = client.newBinaryFormatReader(resp);
Assert.assertNotNull(reader.next());
Expand Down
4 changes: 0 additions & 4 deletions jdbc-v2/src/main/java/com/clickhouse/jdbc/ConnectionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,6 @@ private void checkResultSetFlags(int resultSetType, int resultSetConcurrency, in
throw new SQLFeatureNotSupportedException("Cannot create statement with result set concurrency other then ResultSet.CONCUR_READ_ONLY",
ExceptionUtils.SQL_STATE_FEATURE_NOT_SUPPORTED);
}
if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
throw new SQLFeatureNotSupportedException("Cannot create statement with result set holdability other then ResultSet.CLOSE_CURSORS_AT_COMMIT",
ExceptionUtils.SQL_STATE_FEATURE_NOT_SUPPORTED);
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions jdbc-v2/src/test/java/com/clickhouse/jdbc/ConnectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,11 @@ public void testCreateUnsupportedStatements() throws Throwable {
Assert.ThrowingRunnable[] createStatements = new Assert.ThrowingRunnable[]{
() -> conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY),
() -> conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE),
() -> conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT),
() -> conn.prepareStatement("SELECT 1", Statement.RETURN_GENERATED_KEYS),
() -> conn.prepareStatement("SELECT 1", new int[]{1}),
() -> conn.prepareStatement("SELECT 1", new String[]{"1"}),
() -> conn.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE),
() -> conn.prepareStatement("SELECT 1", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY),
() -> conn.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT),
() -> conn.prepareCall("SELECT 1"),
() -> conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY),
() -> conn.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT),
Expand Down
4 changes: 2 additions & 2 deletions jdbc-v2/src/test/java/com/clickhouse/jdbc/DataTypeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1404,15 +1404,15 @@ public void testJSONWritingAsString() throws SQLException {
double key1 = rand.nextDouble();
int key2 = rand.nextInt();
final String json = "{\"key1\": \"" + key1 + "\", \"key2\": " + key2 + ", \"key3\": [1000, \"value3\", 400000]}";
final String serverJson = "{\"key1\":\"" + key1 + "\",\"key2\":" + key2 + ",\"key3\":[\"1000\",\"value3\",\"400000\"]}";
final String serverJson = "{\"key1\":\"" + key1 + "\",\"key2\":\"" + key2 + "\",\"key3\":[\"1000\",\"value3\",\"400000\"]}";
insertData(String.format("INSERT INTO test_json VALUES ( 1, '%s' )", json));

// Check the results
Properties props = new Properties();
props.setProperty(
ClientConfigProperties.serverSetting(ServerSettings.OUTPUT_FORMAT_BINARY_WRITE_JSON_AS_STRING),
"1");
props.setProperty(ClientConfigProperties.serverSetting("output_format_json_quote_64bit_integers"), "0");
props.setProperty(ClientConfigProperties.serverSetting("output_format_json_quote_64bit_integers"), "1");
try (Connection conn = getJdbcConnection(props)) {
try (Statement stmt = conn.createStatement()) {
try (ResultSet rs = stmt.executeQuery("SELECT * FROM test_json ORDER BY order")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.clickhouse.benchmark.data.DataSet;
import com.clickhouse.client.api.internal.ClickHouseLZ4OutputStream;
import com.clickhouse.client.internal.jpountz.lz4.LZ4Factory;
import com.clickhouse.client.internal.net.jpountz.lz4.LZ4Factory;
import com.clickhouse.data.ClickHouseOutputStream;
import com.clickhouse.data.stream.Lz4OutputStream;
import org.openjdk.jmh.annotations.Benchmark;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<annotations-api.version>6.0.53</annotations-api.version>
<apache.httpclient.version>5.3.1</apache.httpclient.version>
<apache.httpclient.version>5.4.4</apache.httpclient.version>
<arrow.version>12.0.1</arrow.version>
<asm.version>9.7</asm.version>
<avro.version>1.11.4</avro.version>
Expand Down
Loading