Repository navigation
Parse qualified COLUMNS matcher in INSERT column lists - #109176
alexey-milovidov merged 1 commit into
Conversation
An INSERT column list accepted a qualified matcher written as
`q.* [I]LIKE 'pattern'` (parsed by ParserQualifiedAsterisk) but not its
canonical serialization `q.COLUMNS('regexp')`. ParserInsertElement did not
try ParserQualifiedColumnsMatcher, so ParserCompoundIdentifier consumed the
`q.COLUMNS` prefix as a plain identifier and left the trailing `(...)`
unparsed.
Formatting a parsed `q.* [I]LIKE 'pattern'` matcher always yields the
`q.COLUMNS('regexp')` form, which then failed to parse back, so the AST
format round-trip check in executeQueryImpl raised an Inconsistent AST
formatting LOGICAL_ERROR (server abort in debug/sanitizer builds). The AST
fuzzer reaches this via its `* [I]LIKE` matcher generation (STID 1941-26fa).
Add ParserQualifiedColumnsMatcher to ParserInsertElement, before
ParserCompoundIdentifier, mirroring the SELECT expression-element parser so
the INSERT column-list parser accepts the canonical serialization of every
matcher node it can already produce.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260702-112700 |
|
cc @evillique @george-larionov — could you review this? An INSERT column list accepted a qualified matcher as |
|
Workflow [PR], commit [e727a800] Summary: ✅
AI ReviewSummaryThis PR fixes Final Verdict✅ No findings. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 5/5 (100.00%) · Uncovered code |
CI finish ledger — e727a80All checks green: Finish Workflow and Mergeable Check both pass, 0 failed tests and 0 failed jobs in CIDB. Only the private ClickHouse Inc sync check remains, which is exempt.
Session id: cron:our-pr-ci-monitor:20260702-173000 |
Fgrtue
left a comment
There was a problem hiding this comment.
This seems to be the right approach -- to fix the parser in the insert query. LGTM.
|
📊 Cloud Performance Report ✅ AI verdict: This PR is a parser-only fix: it adds a qualified COLUMNS matcher to the INSERT column-list parser (plus one round-trip test) and does not touch the SELECT execution path that ClickBench exercises. On that basis the flagged -22.6% improvement on Q15 is downgraded to variance rather than a real effect, and the +20.6%/+17.5% results on the intrinsically noisy Q30 and Q31 remain not_sure. The suppressed -21.5% on Q4 stays within the master variance band, consistent with no real perf change from this change. clickbenchFlagged queries (3 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
Refresh the branch onto the current master. This picks up the merged fix #109176 ("Parse qualified COLUMNS matcher in INSERT column lists"), which resolves the "Inconsistent AST formatting" logical error (issue #109158, STID 1941-26fa) that the branch's `Stress test (arm_debug)` job was hitting only because the branch predated the fix. Merging pulls the fix in and clears that unrelated red on the next CI run. The merge is clean: master's `play.html` changes since the branch point (the colorize-toggle family) do not conflict with the syntax-error-highlight changes in this PR.
…t-columns-matcher-roundtrip-109158 Parse qualified COLUMNS matcher in INSERT column lists
Refresh the branch onto the current master. This picks up the merged fix ClickHouse#109176 ("Parse qualified COLUMNS matcher in INSERT column lists"), which resolves the "Inconsistent AST formatting" logical error (issue ClickHouse#109158, STID 1941-26fa) that the branch's `Stress test (arm_debug)` job was hitting only because the branch predated the fix. Merging pulls the fix in and clears that unrelated red on the next CI run. The merge is clean: master's `play.html` changes since the branch point (the colorize-toggle family) do not conflict with the syntax-error-highlight changes in this PR.
Bring the branch up to date with master. This pulls in ClickHouse#109176 (`Parse qualified COLUMNS matcher in INSERT column lists`), the root-cause fix for the `Stress test (amd_debug)` AST-fuzzer failure (`Inconsistent AST formatting`, issue ClickHouse#109158), so that red clears on the next CI run.
Closes: #109158
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a parser inconsistency where an
INSERTcolumn list accepted a qualified column matcher written ast.* LIKE '<pattern>'/t.* ILIKE '<pattern>'but rejected its canonicalt.COLUMNS('<regexp>')form, breaking the query format round-trip (and aborting the server in debug/sanitizer builds).Description
ParserInsertElement(the parser for one element of anINSERTcolumn list) triedParserColumnsMatcher,ParserQualifiedAsterisk,ParserAsteriskandParserCompoundIdentifier, but notParserQualifiedColumnsMatcher. So it acceptedt.* [I]LIKE 'pattern'(viaParserQualifiedAsterisk), but ont.COLUMNS('regexp')thet.COLUMNSprefix was consumed byParserCompoundIdentifieras a plain identifier, leaving(...)unparsed.Formatting a parsed
t.* [I]LIKE 'pattern'matcher always emits the canonicalt.COLUMNS('regexp')form, which then failed to parse back. The AST format round-trip self-check inexecuteQueryImpltherefore raised anInconsistent AST formattingLOGICAL_ERROR(exception in release builds, server abort in debug/sanitizer builds). The AST fuzzer reaches this through its* [I]LIKEmatcher generation (STID 1941-26fa).Fix: add
ParserQualifiedColumnsMatchertoParserInsertElement, beforeParserCompoundIdentifier, mirroring the SELECT expression-element parser. The INSERT column-list parser now accepts the canonical serialization of every matcher node it can already produce.Found by the AST fuzzer on
Stress test (amd_debug): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100930&sha=e17029031666298b6c9586e883f05f0016ba2977&name_0=PR&name_1=Stress%20test%20%28amd_debug%29Reproducer (before this change, in a debug build):
Regression test:
tests/queries/0_stateless/04493_insert_columns_matcher_format_roundtrip.sh(format round-trip of qualified/unqualified COLUMNS matchers and regular column lists inINSERT).Version info
26.7.1.804(included in26.7and later)