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 of views column comment #1441

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

7phs
Copy link
Contributor

@7phs 7phs commented Sep 24, 2024

Snowflake supports adding comments to fields within a view:

CREATE OR REPLACE VIEW v (a COMMENT 'Comment of field') AS SELECT a FROM table1

This MR introduces support for this feature.

Additionally, I noticed that the view's comment was not in the correct order—this issue surfaced while testing with a large query from a Snowflake production environment. The comment for the view should appear after the column list. I've included this minor fix in this MR as well. Please let me know if you think it would be better to address this in a separate MR.

@coveralls
Copy link

coveralls commented Sep 24, 2024

Pull Request Test Coverage Report for Build 11101253622

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 27 of 29 (93.1%) changed or added relevant lines in 4 files are covered.
  • 1219 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.03%) to 89.322%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/mod.rs 4 5 80.0%
tests/sqlparser_snowflake.rs 20 21 95.24%
Files with Coverage Reduction New Missed Lines %
src/parser/alter.rs 28 76.07%
src/ast/ddl.rs 64 86.67%
tests/sqlparser_common.rs 300 89.58%
src/ast/mod.rs 391 82.4%
src/parser/mod.rs 436 93.36%
Totals Coverage Status
Change from base Build 10980785660: -0.03%
Covered Lines: 29948
Relevant Lines: 33528

💛 - Coveralls

src/parser/mod.rs Outdated Show resolved Hide resolved
tests/sqlparser_snowflake.rs Outdated Show resolved Hide resolved
src/ast/mod.rs Show resolved Hide resolved
@7phs 7phs requested a review from iffyio September 25, 2024 06:00
src/ast/mod.rs Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
tests/sqlparser_snowflake.rs Show resolved Hide resolved
@7phs 7phs requested a review from iffyio September 30, 2024 07:21
src/parser/mod.rs Outdated Show resolved Hide resolved
src/ast/mod.rs Show resolved Hide resolved
@7phs 7phs requested a review from iffyio October 4, 2024 12:14
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

Copy link
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.

Thank you @7phs and @iffyio

@alamb alamb merged commit 84348d4 into apache:main Oct 7, 2024
10 checks passed
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