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

Snowflake: Support TOP N select clause modifier #2222

Merged
merged 3 commits into from Jan 1, 2022

Conversation

wong-codaio
Copy link
Contributor

@wong-codaio wong-codaio commented Jan 1, 2022

Brief summary of the change made

Snowflake: Support TOP N syntax in SELECT clause, per doc.

  • Added support for TOP N by replacing SelectClauseModifierSegment in Snowflake dialect.

makes progress on #2206

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

  • TOP is now an unreserved keyword in Snowflake dialect (Not sure if this may break rules.)

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
  • Added appropriate documentation for the change.

    • Added link to Snowflake's query syntax.

@codecov
Copy link

codecov bot commented Jan 1, 2022

Codecov Report

Merging #2222 (56a23e3) into main (d41e5b9) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #2222   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          149       149           
  Lines        10874     10878    +4     
=========================================
+ Hits         10874     10878    +4     
Impacted Files Coverage Δ
...rc/sqlfluff/dialects/dialect_snowflake_keywords.py 100.00% <ø> (ø)
src/sqlfluff/dialects/dialect_snowflake.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d41e5b9...56a23e3. Read the comment docs.

@wong-codaio wong-codaio marked this pull request as ready for review January 1, 2022 21:52
Copy link
Contributor

@jpy-git jpy-git left a comment

Choose a reason for hiding this comment

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

Nice work! 👏 LGTM 🚀

@jpy-git jpy-git merged commit fe3a360 into sqlfluff:main Jan 1, 2022
@wong-codaio wong-codaio deleted the wong-support-top-x-in-select branch January 2, 2022 14:38
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.

None yet

2 participants