Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[client-v2] getTableSchema and insert concatenate the raw table name into SQL — names needing backquotes cannot be used

Chiusa
#3,089 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@polyglotAI-bot ci sta già lavorando.

Dal 29/9/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
clickhouse, java

Direzione di ricerca

Inizia in Client.java, in getTableSchema intorno alla riga 2010 e in insert intorno alla riga 1592, quindi segui come viene assemblato il relativo SQL. Riproduci il problema con l'esempio my-table fornito e verifica che i nomi ordinari siano racchiusi tra virgolette, che i nomi già racchiusi tra virgolette rimangano invariati e che entrambe le operazioni abbiano esito positivo per i nomi che richiedono backquotes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:docs client-api-v2
Describe the bug

Client.getTableSchema(table, database) and Client.insert(tableName, ...) paste the table name into SQL as-is:

"DESCRIBE TABLE " + table       // Client.java:2010 (0.10.0)
"INSERT INTO " + tableName      // Client.java:1592 (0.10.0)

So a valid table name that needs backquotes, like my-table, fails with a server syntax error even though the table exists.

Steps to reproduce
client.queryAll("CREATE TABLE `my-table` (id Int64) ENGINE = MergeTree ORDER BY id");
client.getTableSchema("my-table", "default");  // server syntax error
client.insert("my-table", data, settings);     // same
Expected behaviour

The parameter is documented as a table name, so the client should quote it when building the SQL:

DESCRIBE TABLE `my-table`
INSERT INTO `my-table`

Back-compat: pre-quoted names (`my-table` passed by the caller) work today as a workaround, so already-quoted input should be detected and passed through unchanged (like JDBC's Statement.enquoteIdentifier).

Configuration
  • client-v2 0.9.5 and 0.10.0 (latest) are both affected.
Additional context

flink-connector-clickhouse uses both methods and currently has to reject table names that need quoting; once this is fixed the connector can lift that restriction (a canary test watches for it).

Lingua principale
Java
Stelle
1.6k
Fork
638
Merge medio
2g 14h
PR unite (30g)
44

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ClickHouse/clickhouse-java

Tutte le issue di ClickHouse/clickhouse-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.