Skip to content

group by ordinal: Fix bug on aliased columns - #7435

Merged
mattnibs merged 1 commit into
mainfrom
group-by-ordinal-alias
Oct 8, 2026
Merged

mattnibs merged 1 commit into
mainfrom
group-by-ordinal-alias

Conversation

@mattnibs

@mattnibs mattnibs commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

This commit fixes an issue when using group by ordinal on aliased columns that would produce an incorrect expression that could be matched with the original from clause expression. Fix by resolving the expression using the column alias rather the original expression.

Fixes #7357

@mattnibs
mattnibs requested a review from a team October 8, 2026 22:43
@mattnibs
mattnibs force-pushed the group-by-ordinal-alias branch from b387046 to ab1f192 Compare October 8, 2026 22:44
This commit fixes an issue when using group by ordinal on aliased
columns that would produce an incorrect expression that could be
matched with the original from clause expression. Fix by resolving
the expression using the column alias rather the original expression.

Fixes #7357
@mattnibs
mattnibs force-pushed the group-by-ordinal-alias branch from ab1f192 to 959da2c Compare October 8, 2026 22:44

@nwt nwt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People are saying this is how it's done.

@mattnibs
mattnibs merged commit 5aaef35 into main Oct 8, 2026
2 checks passed
@mattnibs
mattnibs deleted the group-by-ordinal-alias branch October 8, 2026 23:06
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.

SQL: GROUP BY <ordinal> fails when the column alias matches an input column name

2 participants