Skip to content

Snowflake: support multiple column options in CREATE VIEW #1891

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

Merged
merged 7 commits into from
Jun 25, 2025

Conversation

eliaperantoni
Copy link
Contributor

@eliaperantoni eliaperantoni commented Jun 18, 2025

A Snowflake query like:

CREATE VIEW X (COL WITH TAG (pii='email') COMMENT 'foobar') AS SELECT * FROM Y

Would've previously failed because of two reasons:

  • It contains two options for the COL column, but only one is currently parsed for CREATE VIEW statements.
  • It uses an option other than COMMENT, which is the only one currently supported for the Snowflake dialect.

This PR fixes both.

Additionally, it records in the AST whether the options are comma separated or not. Otherwise, ToString wouldn't produce a syntactically valid query for Snowflake.

@eliaperantoni eliaperantoni changed the title Support multiple column options in CREATE VIEW Support multiple column options in CREATE VIEW (and non-comment options for Snowflake) Jun 18, 2025
@eliaperantoni eliaperantoni changed the title Support multiple column options in CREATE VIEW (and non-comment options for Snowflake) CREATE VIEW multiple column options and Snowflake fixes Jun 18, 2025
@iffyio iffyio changed the title CREATE VIEW multiple column options and Snowflake fixes Snowflake: support multiple column options in CREATE VIEW Jun 21, 2025
@eliaperantoni
Copy link
Contributor Author

Thank you for your feedback @iffyio, I have addressed it and pushed the changes 😊

@eliaperantoni
Copy link
Contributor Author

Updated @iffyio :) Thanks for your feedback!

@eliaperantoni eliaperantoni requested a review from iffyio June 25, 2025 13:16
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! Thanks @eliaperantoni!
cc @alamb

@iffyio iffyio merged commit 1bbc05c into apache:main Jun 25, 2025
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.

2 participants