ClickHouse / ClickHouse/clickhouse-java

Query parameters can not be parsed in `DESCRIBE TABLE` query with client-v2

オープン
#2,400 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:general bug client-api-v2
主要言語
Java
スター
1.6k
フォーク
636
平均マージ
2日 23時間
マージ済み PR(30日)
29

説明

## Description

Bug with `Client#query(sql, params)` for a `DESCRIBE TABLE` query.

### Steps to reproduce

See the unit test below.
The parameter name is not substituted.

### Error Log or Exception StackTrace

```
com.clickhouse.client.api.ServerException: Code: 62. DB::Exception: Syntax error: failed at position 33 (}): }. Expected substitution type (identifier). (SYNTAX_ERROR)
```

### Expected Behaviour

### Code Example

```java
@Test
void testWeirdBugWithParams() throws Exception {
final Client client = new Client.Builder()
.addEndpoint(Protocol.HTTP, "localhost", 8123, false)
.setUsername("default")
.setPassword("")
.build();
final Map params = Map.of("table_name", "`system`.`tables`");
// This query should not throw an exception
client.query("DESCRIBE TABLE {table_name:String}", params).get();
}

```

### Configuration

#### Client Configuration

See above.
#### Environment
* [ ] Cloud
* Client version: 0.8.6
* Language version: Java 17
* OS: Linux

#### ClickHouse Server
* ClickHouse Server version: 25.3.3.42 (official build)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with Client#query(sql, params) and reproduce the issue using the provided test case and DESCRIBE TABLE query. Trace how the table_name parameter is parsed and substituted; done means the query completes without the syntax error and the regression test passes.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
58/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。