Fix 22 parser issues: alias handling, QUALIFY, WINDOW, EPHEMERAL#18
Merged
kyleconroy merged 6 commits intomainfrom Dec 16, 2025
Merged
Fix 22 parser issues: alias handling, QUALIFY, WINDOW, EPHEMERAL#18kyleconroy merged 6 commits intomainfrom
kyleconroy merged 6 commits intomainfrom
Conversation
- Add alias handling for CastExpr, CaseExpr, ExtractExpr in parseAlias - Add alias handling for same types in parseImplicitAlias - Fix JSON path notation formatting with backticks (x.^`field`) - Add QUALIFY clause output in select explain - Add WINDOW clause output in select explain - Add defaultValueOfTypeName for EPHEMERAL columns without defaults - Add IntervalExpr and TernaryExpr alias handling in explainAliasedExpr Reduced skipped tests from 435 to 413 (22 fixes)
When EXPLAIN is used as a table source (e.g., SELECT * FROM (EXPLAIN ...)), it should be converted to a viewExplain function call in the AST output. This matches ClickHouse's internal representation. Note: EXPLAIN options (like header=1) are not yet fully captured by the parser.
Triple-escape single quotes inside string elements of array literals when used with :: cast syntax. This matches ClickHouse's expected output format of \\\' (three backslashes + quote).
CreateFunctionQuery should have 2 children: Identifier + Lambda body. Previously only output the lambda body. This fixes 12 test cases.
Arrays containing negative number literals (e.g., [-10000, 5750]) should be formatted as Array_[Int64_-10000, UInt64_5750] instead of being converted to Function array. Added isSimpleLiteralOrNegation helper to detect unary negation of numeric literals as "simple" for array formatting purposes. This fixes 10 test cases.
- Remove CastExpr from parseAlias (explicit AS aliases) - Only set alias on CastExpr in parseImplicitAlias when using :: operator syntax - Function-style CAST() aliases go through AliasedExpr instead ClickHouse's EXPLAIN AST doesn't show aliases on function-style CAST() but does show them on :: operator syntax casts.
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.
field)Reduced skipped tests from 435 to 413 (22 fixes)