What problem is being solved?
client.query("DESCRIBE TABLE {table_name:String}", params)fails withCode: 62 ... Syntax error: failed at position 33 (}) ... Expected substitution type (identifier). The client is not dropping the parameter:Client#queryformats it andHttpAPIClientHelper.addStatementParamssends it asparam_table_name. The server rejects the query while parsing it, because in a table-name position ClickHouse only accepts an identifier placeholder ({name:Identifier}), not a value placeholder ({name:String}). The client documentation never says this, so users hit an opaque syntax error. The repo already uses the working form:QueryTestsrunsCREATE TABLE {table_name:Identifier} ....
What user-visible behavior will change?
None. Client behavior stays the same. Users get documentation and an example showing that table, column and database names in a statement must be bound with
{name:Identifier}, plus regression tests that pin both outcomes:Identifiersucceeds, andStringin an identifier position fails with aServerException.
What is the compatibility risk?
None. There is no production-code change:
DataTypeConverterandHttpAPIClientHelperare untouched, so the wire format of query parameters stays the same.
What test will prove the behavior?
Two integration tests will be added to
QueryTests.java:
testQueryParamsInDescribeTablerunsDESCRIBE TABLE system.{table_name:Identifier}with the raw nametablesand verifies the response is returned.testQueryParamsInDescribeTableStringTypeFailsrunsDESCRIBE TABLE {table_name:String}and verifies the failure is aServerException.A third test will cover the two-parameter form
{db:Identifier}.{tbl:Identifier}once the server behavior for dotted names is confirmed. I have not run any of these against a live server yet.
What documentation—CHANGELOG or docs/features? md need to be changed?
•
CHANGELOG.md: add a documentation entry under the current release. •docs/features.md: add one line next to "Named parameter typing is part of the contract" (line 46) saying that identifier positions need{name:Identifier}and that the value is passed raw, not pre-quoted. •Client#queryjavadoc (aroundClient.java:1908): add aDESCRIBE TABLE {table_name:Identifier}example.
What are the proposed changes?
Documentation and tests only. Nothing in the client is changed to guess the placeholder position or rewrite
StringtoIdentifier, because that would need SQL parsing and would silently change the caller's query. Two points to verify against a real server before closing:
- The reporter passes a pre-quoted value (
system`.`tables). WithIdentifierthe server escapes the name itself, so callers should pass the raw name.- Whether a dotted
db.tableinside a singleIdentifieris treated as one identifier. If it is, the documented form is two parameters,{db:Identifier}.{tbl:Identifier}.