Skip to content

Commit 5f377c4

Browse files
authored
Merge pull request #2438 from ClickHouse/fix_2436
[client-v2] Fix not passing query parameter
2 parents 052c3ab + 169ebab commit 5f377c4

File tree

1 file changed

+4
-4
lines changed
  • client-v2/src/main/java/com/clickhouse/client/api

1 file changed

+4
-4
lines changed

client-v2/src/main/java/com/clickhouse/client/api/Client.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,8 +1671,8 @@ public List<GenericRecord> queryAll(String sqlQuery, Map<String, Object> params,
16711671
int operationTimeout = getOperationTimeout();
16721672
settings.setFormat(ClickHouseFormat.RowBinaryWithNamesAndTypes)
16731673
.waitEndOfQuery(true);
1674-
try (QueryResponse response = operationTimeout == 0 ? query(sqlQuery, params, settings).get() :
1675-
query(sqlQuery, settings).get(operationTimeout, TimeUnit.MILLISECONDS)) {
1674+
CompletableFuture<QueryResponse> f = query(sqlQuery, params, settings);
1675+
try (QueryResponse response = operationTimeout == 0 ? f.get() : f.get(operationTimeout, TimeUnit.MILLISECONDS)) {
16761676
List<GenericRecord> records = new ArrayList<>();
16771677
if (response.getResultRows() > 0) {
16781678
RowBinaryWithNamesAndTypesFormatReader reader =
@@ -1738,8 +1738,8 @@ public <T> List<T> queryAll(String sqlQuery, Class<T> clazz, TableSchema schema,
17381738
try {
17391739
int operationTimeout = getOperationTimeout();
17401740
QuerySettings settings = new QuerySettings().setFormat(ClickHouseFormat.RowBinaryWithNamesAndTypes);
1741-
try (QueryResponse response = operationTimeout == 0 ? query(sqlQuery, settings).get() :
1742-
query(sqlQuery, settings).get(operationTimeout, TimeUnit.MILLISECONDS)) {
1741+
CompletableFuture<QueryResponse> f = query(sqlQuery, settings);
1742+
try (QueryResponse response = operationTimeout == 0 ? f.get() : f.get(operationTimeout, TimeUnit.MILLISECONDS)) {
17431743
List<T> records = new ArrayList<>();
17441744
RowBinaryWithNamesAndTypesFormatReader reader =
17451745
(RowBinaryWithNamesAndTypesFormatReader) newBinaryFormatReader(response);

0 commit comments

Comments
 (0)