Skip to content

Snowflake: Improve accuracy of lookahead in implicit LIMIT alias #1941

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 2 commits into
base: main
Choose a base branch
from

Conversation

yoavcloud
Copy link
Contributor

Some needed adjustments to the lookahead logic when considering the LIMIT keyword as an implicit table alias.

Keyword::LIMIT
if matches!(
parser.peek_token().token,
Token::Number(_, _) | Token::Placeholder(_)
Copy link
Contributor

Choose a reason for hiding this comment

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

from their docs they seem to mention that null and empty string, $ values are possible, could we also detect for those here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the great feedback! The latest commit introduces a more accurate lookahead logic.

@yoavcloud yoavcloud force-pushed the sf_limit_lookahead branch from 6e08364 to 7240269 Compare July 16, 2025 04:56
@yoavcloud yoavcloud requested a review from iffyio July 16, 2025 04:57
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