Skip to content

Commit e50ce10

Browse files
committed
Merge branch 'main' into jdbc_v2_row_binary_writer
2 parents 8ecbe79 + 547e352 commit e50ce10

File tree

18 files changed

+328
-26
lines changed

18 files changed

+328
-26
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
env:
1414
CHC_BRANCH: "main"
15-
CHC_VERSION: "0.8.2"
15+
CHC_VERSION: "0.8.5"
1616
CH_VERSION: "24.8"
1717

1818
jobs:

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## 0.8.5
2+
3+
### Improvements
4+
- [jdbc-v2] Added debug output for final SQL. (https://github.com/ClickHouse/clickhouse-java/issues/2249)
5+
6+
### Bug Fixes
7+
- [client-v2] Fixed creating TableSchema for materialized views. It resolves issues with POJO serde. (https://github.com/ClickHouse/clickhouse-java/issues/2118,
8+
https://github.com/ClickHouse/clickhouse-java/issues/2025)
9+
- [client-v2, jdbc-v2] Fixed handling `Nullable` inside `SimpleAggregateFunction` columns. (https://github.com/ClickHouse/clickhouse-java/issues/2110)
10+
- [jdbc-v2] Fixed problem with server info request. It is fetched now when timezone of the server is set. (https://github.com/ClickHouse/clickhouse-java/issues/2191)
11+
- [jdbc-v2] Fixed null response for `getIndexInfo()`. Empty Result Set is returned. (https://github.com/ClickHouse/clickhouse-java/issues/2286)
12+
- [jdbc-v2] Fixed wrong `false` response in `DataBaseMetadata.supportsBatchUpdates()`. Returns `true` now. Please note that
13+
no update is supported for result sets.
14+
- [jdbc-v2] Fixed handling UUID data type in PreparedStatement. (https://github.com/ClickHouse/clickhouse-java/issues/2327)
15+
- [jdbc-v2] Fixed unsigned integer type matching. `UInt8`, `UInt16`, `UInt32`, `UInt64`, `UInt128`, `UInt256` are presented as
16+
`short`, `int`, `long`, `BigInteger`, `BigInteger`, `BigInteger` correspondingly. SQLType for them is `OTHER` because
17+
JDBC (as well as Java) doesn't provide good mapping for unsigned integers. (https://github.com/ClickHouse/clickhouse-java/issues/2333)
18+
- [jdbc-v2] Disallowed to call method from `Statement` interface on `PreparedStatement` instance according to the JDBC spec. (https://github.com/ClickHouse/clickhouse-java/issues/2339)
19+
120
## 0.8.4
221

322
### Examples
@@ -18,6 +37,7 @@ Complete metadata is returned only after statement execution. Partial metadata i
1837
of the statement. (https://github.com/ClickHouse/clickhouse-java/issues/2292)
1938
- [jdbc-v2] Fixed `clearParameters` in `PreparedStatementImpl` to correctly reset parameters array. (https://github.com/ClickHouse/clickhouse-java/issues/2299)
2039
- [jdbc-v2] Fixed logging. (https://github.com/ClickHouse/clickhouse-java/pull/2303)
40+
- [jdbc-v2] Fixed metadata field `DATA_TYPE` being `String` (https://github.com/ClickHouse/clickhouse-java/issues/2240)
2141

2242
## 0.8.3
2343

client-v2/src/main/java/com/clickhouse/client/api/data_formats/internal/BinaryStreamReader.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ public <T> T readValue(ClickHouseColumn column, Class<?> typeHint) throws IOExce
234234
return (T) readVariant(actualColumn);
235235
case Dynamic:
236236
return (T) readValue(actualColumn, typeHint);
237+
case Nested:
238+
return convertArray(readNested(actualColumn), typeHint);
237239
default:
238240
throw new IllegalArgumentException("Unsupported data type: " + actualColumn.getDataType());
239241
}
@@ -785,6 +787,33 @@ public Object[] readTuple(ClickHouseColumn column) throws IOException {
785787
return tuple;
786788
}
787789

790+
/**
791+
* Reads a nested into an ArrayValue object.
792+
* @param column - column information
793+
* @return array value
794+
* @throws IOException when IO error occurs
795+
*/
796+
public ArrayValue readNested(ClickHouseColumn column) throws IOException {
797+
int len = readVarInt(input);
798+
if (len == 0) {
799+
return new ArrayValue(Object[].class, 0);
800+
}
801+
802+
ArrayValue array;
803+
array = new ArrayValue(Object[].class, len);
804+
for (int i = 0; i < len; i++) {
805+
int tupleLen = column.getNestedColumns().size();
806+
Object[] tuple = new Object[tupleLen];
807+
for (int j = 0; j < tupleLen; j++) {
808+
tuple[j] = readValue(column.getNestedColumns().get(j));
809+
}
810+
811+
array.set(i, tuple);
812+
}
813+
814+
return array;
815+
}
816+
788817
public Object readVariant(ClickHouseColumn column) throws IOException {
789818
int ordNum = readByte();
790819
return readValue(column.getNestedColumns().get(ordNum));

client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ private void addQueryParams(URIBuilder req, Map<String, String> chConfig, Map<St
556556
Collection<String> sessionRoles = (Collection<String>) requestConfig.getOrDefault(ClientConfigProperties.SESSION_DB_ROLES.getKey(),
557557
ClientConfigProperties.valuesFromCommaSeparated(chConfiguration.getOrDefault(ClientConfigProperties.SESSION_DB_ROLES.getKey(), "")));
558558
if (!sessionRoles.isEmpty()) {
559-
560559
sessionRoles.forEach(r -> req.addParameter(ClickHouseHttpProto.QPARAM_ROLE, r));
561560
}
562561

examples/client-v2/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5555
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5656

57-
<clickhouse-java.version>0.8.4-SNAPSHOT</clickhouse-java.version>
57+
<clickhouse-java.version>0.8.5-SNAPSHOT</clickhouse-java.version>
5858

5959
<compiler-plugin.version>3.8.1</compiler-plugin.version>
6060

examples/client/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4141
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4242

43-
<clickhouse-java.version>0.8.4-SNAPSHOT</clickhouse-java.version>
43+
<clickhouse-java.version>0.8.5-SNAPSHOT</clickhouse-java.version>
4444
<!-- Nightly snapshot version from https://s01.oss.sonatype.org/content/repositories/snapshots/ or latest from local -->
45-
<!-- <clickhouse-java.version>0.8.4-SNAPSHOT</clickhouse-java.version>-->
45+
<!-- <clickhouse-java.version>0.8.5-SNAPSHOT</clickhouse-java.version>-->
4646

4747
<apache-httpclient.version>5.2.1</apache-httpclient.version>
4848

examples/demo-kotlin-service/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ ktor_version=2.3.12
33
kotlin_version=2.0.20
44
logback_version=1.4.14
55

6-
ch_java_client_version=0.8.4
6+
ch_java_client_version=0.8.5
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
ch_java_client_version=0.8.4
2+
ch_java_client_version=0.8.5

examples/jdbc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4848
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4949

50-
<clickhouse-java.version>0.8.4-SNAPSHOT</clickhouse-java.version>
50+
<clickhouse-java.version>0.8.5-SNAPSHOT</clickhouse-java.version>
5151
<hikaricp.version>4.0.3</hikaricp.version>
5252
<apache-httpclient.version>5.2.1</apache-httpclient.version>
5353

examples/r2dbc/clickhouse-r2dbc-spring-webflux-sample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<properties>
1515
<maven.compiler.source>1.8</maven.compiler.source>
1616
<maven.compiler.target>1.8</maven.compiler.target>
17-
<clickhouse-java.version>0.8.4-SNAPSHOT</clickhouse-java.version>
17+
<clickhouse-java.version>0.8.5-SNAPSHOT</clickhouse-java.version>
1818
<spring-boot-starter.version>2.7.18</spring-boot-starter.version>
1919
</properties>
2020

0 commit comments

Comments
 (0)