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

Add support for TOP before ALL/DISTINCT #1495

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

yoavcloud
Copy link
Contributor

@yoavcloud yoavcloud commented Oct 31, 2024

Adds support for dialects (Redshift) that expect the TOP keyword in a SELECT statement to appear before the ALL/DISTINCT option. For example: SELECT TOP 2 DISTINCT FROM tbl;
https://docs.aws.amazon.com/redshift/latest/dg/r_SELECT_list.html

@yoavcloud yoavcloud force-pushed the redshift_select_top branch from 35400c3 to 1752a4a Compare October 31, 2024 22:50
src/parser/mod.rs Outdated Show resolved Hide resolved
src/dialect/mod.rs Outdated Show resolved Hide resolved
src/dialect/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
tests/sqlparser_redshift.rs Outdated Show resolved Hide resolved
src/keywords.rs Outdated Show resolved Hide resolved
@yoavcloud yoavcloud requested a review from iffyio November 3, 2024 09:24
@yoavcloud yoavcloud force-pushed the redshift_select_top branch from 72544c3 to eb698ee Compare November 4, 2024 08:23
@iffyio iffyio changed the title TOP before ALL/DISTINCT Add suppport for TOP before ALL/DISTINCT Nov 6, 2024
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! cc @alamb

@yoavcloud yoavcloud force-pushed the redshift_select_top branch from 3d25465 to 9eec5f3 Compare November 6, 2024 15:53
@alamb alamb changed the title Add suppport for TOP before ALL/DISTINCT Add support for TOP before ALL/DISTINCT Nov 6, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11707166854

Details

  • 23 of 25 (92.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.391%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/dialect/mod.rs 1 2 50.0%
src/dialect/redshift.rs 1 2 50.0%
Totals Coverage Status
Change from base Build 11707125112: 0.0%
Covered Lines: 30587
Relevant Lines: 34217

💛 - Coveralls

@alamb alamb merged commit a5b0092 into apache:main Nov 6, 2024
10 checks passed
@alamb
Copy link
Contributor

alamb commented Nov 6, 2024

Thanks @yoavcloud and @iffyio

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.

4 participants