Repository navigation
Clear the explain_todo statements added by parameter substitution - #145
Open
kyleconroy wants to merge 7 commits into
Open
kyleconroy wants to merge 7 commits into
kyleconroy wants to merge 7 commits into
Conversation
ALTER QUOTA now goes through the CREATE QUOTA parser, which matches the CreateQuotaQuery node ClickHouse prints for both. SHOW CREATE QUOTA with more than one name prints as SHOW CREATE QUOTAS. Clears all 24 todo statements in 01297_create_quota. Claude-Session: https://claude.ai/code/session_01LuRZ4GWXBrmUXAf6RUPFSs Co-authored-by: Claude <noreply@anthropic.com>
) - SHOW TABLES accepts IN as well as FROM. - COLUMN can be an implicit alias (select x column). - Double-quoted identifiers use the same escape rules as backquoted ones, so unknown escapes keep their backslash; identifier and column names are escaped like ClickHouse's writeEscapedString when printed. - The DISTINCT group of a mixed union flattens nested unions, matching NormalizeSelectWithUnionQueryMatcher. - EXPLAIN CURRENT TRANSACTION works as a subquery (viewExplain with two arguments). - A query parameter in WITH keeps its alias. - INTERVAL CASE ... END <unit> parses as an interval. - WITH elements cloned into later SELECTs of a union print TableJoin before TableExpression, as ASTTablesInSelectQueryElement::clone does. explain_todo is empty again. Claude-Session: https://claude.ai/code/session_01LuRZ4GWXBrmUXAf6RUPFSs Co-authored-by: Claude <noreply@anthropic.com>
ClickHouse reads "# " and "#!" as line comments. Both statement splitters joined such a line into the next statement, so the comment swallowed it and ClickHouse returned an error instead of EXPLAIN output. Both splitters now skip these lines, except inside a multi-line string literal. Regenerating adds 53 explain files, and all of them pass. Claude-Session: https://claude.ai/code/session_01LuRZ4GWXBrmUXAf6RUPFSs Co-authored-by: Claude <noreply@anthropic.com>
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.
Claude-Session: https://claude.ai/code/session_01LuRZ4GWXBrmUXAf6RUPFSs
Co-authored-by: Claude <noreply@anthropic.com>
Test harness: - String parameters are substituted after parsing (ast.Parameter.Value), so (p1, p2) stays a tuple function as in ClickHouse. - Parameters inside quoted strings and in a view's body are left alone. Parser and EXPLAIN: - TRUNCATE [ALL] TABLES FROM [IF EXISTS] db [[NOT] [I]LIKE ...]. - RENAME without TABLE. - UPDATE db.table prints the database identifier; ON CLUSTER is accepted. - CREATE TABLE ... AS SELECT ... FORMAT x puts FORMAT on the CREATE query. - CREATE DATABASE ... SETTINGS without an engine prints query settings. - Table names in CREATE are escaped like other dumped names. - ATTACH DATABASE hides engine secrets as CREATE does. - ALTER TABLE ... MODIFY REFRESH. explain_todo is empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuRZ4GWXBrmUXAf6RUPFSs
…-wk8rxb-params-todo # Conflicts: # parser/parser_test.go # parser/testdata/00080_show_tables_and_system_tables/metadata.json
The merge took main's explain_todo entries for statements this branch fixes. 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 #144. This fixes the 49
explain_todostatements that #144 added, soexplain_todois empty again.Test harness substitution, now closer to ClickHouse's
ReplaceQueryParameterVisitorast.Parameter.Valuefield. EXPLAIN prints the literal, but the AST keeps its parameter shape, soIN ({a:String}, {b:String})staysFunction tupleinstead of folding into a tuple literal.Parser and EXPLAIN
TRUNCATE [ALL] TABLES FROM [IF EXISTS] db [[NOT] [I]LIKE ...]RENAME a TO bwithoutTABLEUPDATE db.tprints the database identifier and acceptsON CLUSTERCREATE TABLE ... AS SELECT ... FORMAT xputs FORMAT on the CREATE queryCREATE DATABASE ... SETTINGSwith no engine prints query settingstest%_\\_)ATTACH DATABASE ... ENGINE = MySQL(...)hides the password, as CREATE doesALTER TABLE ... MODIFY REFRESH. The REFRESH parsing for CREATE is now a sharedparseRefreshStrategymethod.go test ./...passes.-check-explainleaves no pending statements.Generated by Claude Code