Skip to content

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
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.

LGTM! Thanks @yoavcloud!
cc @alamb

@iffyio iffyio merged commit 15f35e1 into apache:main Jul 11, 2025
10 checks 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.

2 participants