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).
Describe the bug
Client.getTableSchema(table, database)andClient.insert(tableName, ...)paste the table name into SQL as-is: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
Expected behaviour
The parameter is documented as a table name, so the client should quote it when building the SQL:
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'sStatement.enquoteIdentifier).Configuration
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).