You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Query parameters can not be parsed in DESCRIBE TABLE query with client-v2 #2400
clientModule: the client (client-v2; with legacy: the v1 client)queriesArea: how the client builds and runs statements (parameters, quoting, batches)question
changed the title [-]Query parameters are ignored in ` "DESCRIBE TABLE" query with client-v2[/-][+]Query parameters are ignored in `DESCRIBE TABLE` query with client-v2[/+]on Jun 2, 2025
changed the title [-]Query parameters are ignored in `DESCRIBE TABLE` query with client-v2[/-][+]Query parameters can not be parsed in `DESCRIBE TABLE` query with client-v2[/+]on Jun 3, 2025
Effort to Fix: Small Type: Bug Affected Module: client-v2 (client-api-v2)
Summary
When calling Client#query("DESCRIBE TABLE {table_name:String}", params), the server rejects the query with a syntax error at position 33 (the closing } of the substitution). The client correctly passes param_table_name as a URL query parameter, but ClickHouse cannot apply {name:String} substitution in a DESCRIBE TABLE table-name position because String-typed parameters are resolved as quoted string literals — making the resulting SQL (DESCRIBE TABLE 'system.tables') syntactically invalid. The correct ClickHouse type for substituting an identifier (table/column name) is Identifier, not String. It is not yet confirmed whether this is a pure user-education issue or whether the client should detect and surface a clearer error.
Recommended Labels & Priority
Labels: bug, client-api-v2, area:client-read
Missing Information / Questions for User
Does changing the query to DESCRIBE TABLE {table_name:Identifier} (type Identifier instead of String) resolve the error?
Can you share the raw HTTP request (enable debug logging with -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG) to confirm param_table_name is included in the URL?
Is the issue reproducible with other ClickHouse server versions (e.g., 24.x)?
Tests to Add
Test 1: DESCRIBE TABLE with Identifier-typed query parameter
@Test(groups = {"integration"})
publicvoidtestQueryParamsInDescribeTable() throwsException {
// {name:Identifier} is the correct ClickHouse type for a table-name substitutionfinalMap<String, Object> params = Map.of("table_name", "system.tables");
try (QueryResponseresponse =
client.query("DESCRIBE TABLE {table_name:Identifier}", params).get()) {
Assert.assertNotNull(response);
}
}
Test 2: DESCRIBE TABLE with String-typed parameter should fail with a clear error
@Test(groups = {"integration"})
publicvoidtestQueryParamsInDescribeTableStringTypeFails() {
// String type resolves to a quoted literal, which is invalid in the table-name position;// verify the client surfaces a ServerException rather than an opaque failure.finalMap<String, Object> params = Map.of("table_name", "system.tables");
try {
client.query("DESCRIBE TABLE {table_name:String}", params).get();
Assert.fail("Expected ServerException");
} catch (ExecutionExceptione) {
Assert.assertTrue(e.getCause() instanceofServerException,
"Expected ServerException, got: " + e.getCause());
}
}
Recommendation: Close — no-op: works as intended
The server accepts only the type Identifier for a parameter in a table-name position, and the client sends the query and the parameter unchanged. Correct usage: DESCRIBE TABLE {db:Identifier}.{table:Identifier} with db=system and table=tables.
Status on main: Not a bug — the issue's test gives the error that it shows, and curl with no client gives the same SYNTAX_ERROR. Two Identifier parameters work.
Analysis: In a table-name position, the server parser accepts only a {name:Identifier} substitution, so {table_name:String} fails with Expected substitution type (identifier) before the server uses the value. One Identifier value is one name: the server reads `system`.`tables` as one table name, so the database and the table need a parameter each.
Reproduction: complete program and output
Changed from the issue's steps: the test body is in main, and two cases with Identifier parameters are added.
clientModule: the client (client-v2; with legacy: the v1 client)queriesArea: how the client builds and runs statements (parameters, quoting, batches)question
Activity
[-]Query parameters are ignored in ` "DESCRIBE TABLE" query with client-v2[/-][+]Query parameters are ignored in `DESCRIBE TABLE` query with client-v2[/+][-]Query parameters are ignored in `DESCRIBE TABLE` query with client-v2[/-][+]Query parameters can not be parsed in `DESCRIBE TABLE` query with client-v2[/+]chernser commentedon Jul 9, 2026
/triage
github-actions commentedon Jul 9, 2026
Triage Report
Effort to Fix: Small
Type: Bug
Affected Module: client-v2 (client-api-v2)
Summary
When calling
Client#query("DESCRIBE TABLE {table_name:String}", params), the server rejects the query with a syntax error at position 33 (the closing}of the substitution). The client correctly passesparam_table_nameas a URL query parameter, but ClickHouse cannot apply{name:String}substitution in aDESCRIBE TABLEtable-name position becauseString-typed parameters are resolved as quoted string literals — making the resulting SQL (DESCRIBE TABLE 'system.tables') syntactically invalid. The correct ClickHouse type for substituting an identifier (table/column name) isIdentifier, notString. It is not yet confirmed whether this is a pure user-education issue or whether the client should detect and surface a clearer error.Recommended Labels & Priority
Missing Information / Questions for User
DESCRIBE TABLE {table_name:Identifier}(typeIdentifierinstead ofString) resolve the error?-Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG) to confirmparam_table_nameis included in the URL?Tests to Add
Test 1: DESCRIBE TABLE with Identifier-typed query parameter
Test 2: DESCRIBE TABLE with String-typed parameter should fail with a clear error
kishansinghifs1 commentedon Jul 22, 2026
Hii @chernser I would like to work on it.
chernser commentedon Jul 22, 2026
@kishansinghifs1
What would be the fix?
please describe briefly.
Thanks!
kishansinghifs1 commentedon Sep 26, 2026
Hiii @chernser, so sorry! I was going through some health issues and wasn’t really able to get back to you. Apologies for the delayed response.
kishansinghifs1 commentedon Sep 26, 2026
Here is the doc containing the implementation proposal along with the queries that need to be answered:
Issue:#2827
chernser commentedon Sep 27, 2026
@kishansinghifs1
no worries!
Thank you for the document - I will read next week.
polyglotAI-bot commentedon Nov 28, 2026
Recommendation: Close — no-op: works as intended
The server accepts only the type
Identifierfor a parameter in a table-name position, and the client sends the query and the parameter unchanged. Correct usage:DESCRIBE TABLE {db:Identifier}.{table:Identifier}withdb=systemandtable=tables.main: Not a bug — the issue's test gives the error that it shows, andcurlwith no client gives the sameSYNTAX_ERROR. TwoIdentifierparameters work.Identifiervalue.Analysis: In a table-name position, the server parser accepts only a
{name:Identifier}substitution, so{table_name:String}fails withExpected substitution type (identifier)before the server uses the value. OneIdentifiervalue is one name: the server reads`system`.`tables`as one table name, so the database and the table need a parameter each.Reproduction: complete program and output
Changed from the issue's steps: the test body is in
main, and two cases withIdentifierparameters are added.Output on
main(8480ca001), ClickHouse 26.11.4.11:Automated triage by Polyglot AI. A maintainer makes the final decision.