Skip to content

Snowflake Reserved SQL Keywords as Implicit Table Alias #1934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yoavcloud
Copy link
Contributor

Following the same pattern of Dialect::is_select_item_alias for table aliases. Added handling for Snowflake-specific keywords when used as an implicit table alias (i.e. without AS).

@yoavcloud yoavcloud changed the title Sd reserverd kws tables alias Snowflake Reserved SQL Keywords as Implicit Table Alias Jul 9, 2025
Copy link
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.

Thanks @yoavcloud! Just a minor comment re peeking otherwise this looks good to me

if parser.peek_keyword(Keyword::FIRST)
|| parser.peek_keyword(Keyword::NEXT)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if parser.peek_keyword(Keyword::FIRST)
|| parser.peek_keyword(Keyword::NEXT)
if parser.peek_one_of_keyword(&[Keyword::FIRST, Keyword::NEXT])

I think this would be equivalent and simplify?

@yoavcloud yoavcloud force-pushed the sd_reserverd_kws_tables_alias branch from e48fe75 to cdfd75f Compare July 10, 2025 16:08
@yoavcloud yoavcloud requested a review from iffyio July 10, 2025 16:15
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