Repository navigation
Substitute the test runner's database parameters - #144
Merged
kyleconroy merged 1 commit intoDec 1, 2026
Merged
kyleconroy merged 1 commit into
kyleconroy merged 1 commit into
Conversation
Statements that use {CLICKHOUSE_DATABASE:Identifier} and similar never
got explain files, because ClickHouse refuses to explain them without a
value and substitutes the value before printing when one is given.
regenerate-explain now sends fixed values (test_db, test_db_1,
test_db_2), and the parser tests substitute the same names before parsing.
This adds 2,055 explain files. 2,006 statements pass; the other 49 are
recorded in explain_todo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4GWXBrmUXAf6RUPFSs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Kyle · project thread
Summary
Stacked on #143. This fixes the second explain-generator gap found in #139.
Statements that use
{CLICKHOUSE_DATABASE:Identifier},{CLICKHOUSE_DATABASE_1:String}and similar never got explain files. Without a value ClickHouse refuses to explain them (UNKNOWN_QUERY_PARAMETER). With a value, it substitutes it before printing the AST.cmd/regenerate-explainnow passesparam_CLICKHOUSE_DATABASE=test_db(and_1,_2) on every request, as ClickHouse's own test runner does.parser/parser_test.gosubstitutes the same names before parsing (substituteTestParams).Only the six
CLICKHOUSE_DATABASE*forms are substituted, so other query parameters still parse asQueryParameter. No existing explain file changed.This adds 2,055 explain files across about 157 tests. 2,006 of those statements pass. The other 49, in 15 tests, are recorded in
explain_todofor a follow-up.Open question for review: these statements now test the substituted SQL, not the
{param}syntax. That is the only ground truth ClickHouse can give for them.Generated by Claude Code