Skip to content

Align Snowflake dialect to new test of reserved keywords#1924

Merged
iffyio merged 2 commits intoapache:mainfrom
yoavcloud:sf_reserved_column_idents
Jul 5, 2025
Merged

Align Snowflake dialect to new test of reserved keywords#1924
iffyio merged 2 commits intoapache:mainfrom
yoavcloud:sf_reserved_column_idents

Conversation

@yoavcloud
Copy link
Copy Markdown
Contributor

We've encountered a problem parsing statements like SELECT 1, sort FROM tbl which are valid in Snowflake.

The reason is that in the Snowflake dialect, supports_projection_trailing_commas is true. The flow then checks the keyword after the comma to see if it's reserved (FROM for example), and if not, it stops parsing the projection. However, the check relies on Dialect::is_column_alias which wasn't implemented in the Snowflake dialog.

The solution is to align the behavior of the Snowflake dialect to other dialects by overriding Dialect::is_column_alias instead of Dialect::is_select_item_alias.

Copy link
Copy Markdown
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @yoavcloud!
cc @alamb

@iffyio iffyio merged commit ed8757f into apache:main Jul 5, 2025
10 checks passed
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Feb 3, 2026
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.

2 participants