Skip to content

snowflake: fix rendering of SELECT TOP#1070

Merged
alamb merged 1 commit intoapache:mainfrom
jmhain:joey/sf-top-fix
Dec 22, 2023
Merged

snowflake: fix rendering of SELECT TOP#1070
alamb merged 1 commit intoapache:mainfrom
jmhain:joey/sf-top-fix

Conversation

@jmhain
Copy link
Copy Markdown
Contributor

@jmhain jmhain commented Dec 21, 2023

In Snowflake, SELECT TOP only supports an unparenthesized integer constant as its operand. This syntax was being parsed successfully but the Display impl was rendering MSSQL style (i.e. with parentheses), which causes the resultant queries to fail in Snowflake. I fixed this by distinguishing the two different syntactic forms for TOP in the AST.

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 21, 2023

Pull Request Test Coverage Report for Build 7293605325

  • 20 of 21 (95.24%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 87.678%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 5 6 83.33%
Totals Coverage Status
Change from base Build 7280713756: 0.003%
Covered Lines: 18287
Relevant Lines: 20857

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@alamb alamb 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 to me -- thank you @jmhain

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.

3 participants