Skip to content
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

Bugfix, frame clauses in window functions were not working #1381

Merged
merged 4 commits into from
Sep 12, 2021

Conversation

WittierDinosaur
Copy link
Contributor

@WittierDinosaur WittierDinosaur commented Sep 11, 2021

Brief summary of the change made

IGNORE/ RESPECT NULLS were incorrectly in the PostFunctionGrammar, making window functions including them unparsable. This has been fixed. Also made the FrameClauseSegment more explicit, as it's specified in the Redshift docs.

Fixes #1379

Are there any other side effects of this change that we should be aware of?

No. Some test cases now have more explicit Frame Clauses.

Pull Request checklist

Tested, no previous tests have been broken.
Added example in #1379 to Postgres tests, and parses correctly.
Docs link to ANSI and Postgres docs specifying Frame Clause

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

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

Looks good. One suggestion.

src/sqlfluff/dialects/dialect_ansi.py Outdated Show resolved Hide resolved
src/sqlfluff/dialects/dialect_ansi.py Outdated Show resolved Hide resolved
Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

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

LGTM if you can fix the merge conflict.

Nice use of reducing duplicated code through those _frame* definitions.

@tunetheweb tunetheweb merged commit 27a2301 into sqlfluff:main Sep 12, 2021
@WittierDinosaur WittierDinosaur deleted the frame-clause-ansi-bugfix branch September 12, 2021 17:00
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.

Support redshift 'ignore nulls' clause
2 participants