Repository navigation
Wrap complex tuple expressions with indexes in parentheses - #96799
Merged
Merged
Conversation
george-larionov
force-pushed
the
ast-inconsistency-with-tuple-indexing
branch
2 times, most recently
from
February 13, 2026 02:22
4a9617a to
df44040
Compare
Contributor
george-larionov
marked this pull request as ready for review
February 13, 2026 02:23
george-larionov
force-pushed
the
ast-inconsistency-with-tuple-indexing
branch
from
February 13, 2026 15:45
df44040 to
8bb79c5
Compare
Member
Author
|
Updated a few tests to match new changes: In It is a bit more clunky now but I think a reasonable trade off, since it should be a rare case anyway. And in |
alexey-milovidov
approved these changes
Feb 14, 2026
alexey-milovidov
left a comment
Member
There was a problem hiding this comment.
Ok, although ((t1.1).1).1 does not look pretty.
Member
|
But it's good enough as an immediate fix for CI failures. |
alexey-milovidov
added a commit
that referenced
this pull request
Feb 14, 2026
…nt access PR #96799 added parenthesization around the left operand in `tupleElement` formatting when `size() > 1`, to fix `(tab.*).N` formatting. However, this check was too broad: it also wrapped `ASTFunction("array")` and `ASTFunction("tuple")` in extra parens (e.g., `([['你们']]).3`). When re-parsed, the parser's fast literal path converts `[['你们']]` to `ASTLiteral(Array(...))` which has `size() == 1`, so no parens are added on the second format pass. The formatted strings differ, triggering the debug AST consistency check exception. The fix excludes `array` and `tuple` functions from the extra parenthesization since their bracket syntax (`[...]` and `(...)`) is already unambiguous with `.N` access. The necessary parens for `(tab.*).N` and `((t1.1).1).1` are preserved. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96871&sha=8c08d137d9d40503cff353ed51ec4c8cf55e9d38&name_0=PR&name_1=BuzzHouse%20%28amd_debug%29 Co-Authored-By: Claude Opus 4.6 <[email protected]>
This was referenced Feb 14, 2026
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.
Fix issues with complex tuple expressions, such as:
SELECT (tab.*).2 FROM tab;
See this failure.
Changelog category (leave one):
Version info
26.2.1.659