Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

ClickHouse's EXPLAIN AST output optimizes UNION ALL queries when all
SELECTs have identical expressions but different column aliases. Since
column names come from the first SELECT, subsequent SELECTs are elided
in the AST output.

This adds simplifyUnionSelects() to match this behavior, fixing test
00592_union_all_different_aliases.

ClickHouse's EXPLAIN AST output optimizes UNION ALL queries when all
SELECTs have identical expressions but different column aliases. Since
column names come from the first SELECT, subsequent SELECTs are elided
in the AST output.

This adds simplifyUnionSelects() to match this behavior, fixing test
00592_union_all_different_aliases.
@kyleconroy kyleconroy merged commit f8d2efd into main Dec 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants