Document limitation: cannot flatten OR/AND chains in EXPLAIN output #92
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.
The 02711_trim_aliases test expects OR chains like "a OR b OR c" to be
flattened to or(a, b, c) with 3 children. However, tests like 01661_join_complex
expect "(a OR b) OR c" to remain nested as or(or(a,b), c) with 2 children.
Both SQL patterns produce identical parse trees due to left-associative parsing.
Our parser doesn't track explicit parenthesization, but ClickHouse's EXPLAIN
output distinguishes between them based on the original SQL syntax.
Since we cannot tell implicit grouping apart from explicit parentheses at the
AST level, any fix for 02711 would break 01661 (and vice versa).
The 02711_trim_aliases test remains in explain_todo as this is a fundamental
limitation of our parser architecture.