-
Notifications
You must be signed in to change notification settings - Fork 709
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
Refactor POST_CREATE and POST_EXPRESSION properties #1219
Conversation
The Teradata syntax "CREATE VOLATILE TABLE" isn't supported in Snowflake, and the "obvious" way to handle is to set the volatility property to unsupported in Snowflake. However, the volatility property is also mapped to keyword IMMUTABLE (which snowflake does support). You can see in Line 536 in b143418
Not sure the best way to handle this. We can pull them into separate properties, but that will complicate transpiling one of those words to another. |
I also see that the CREATE_TRANSIENT flag was essentially playing the role of UNSUPPORTED properties for the Transient property in POST_CREATE location. I don't see this being used in any other dialects, so I'll remove it when responding to review comments. Line 90 in b143418
sqlglot/sqlglot/dialects/snowflake.py Line 218 in b143418
|
Maybe you can also check if the string captured in |
That makes sense, but I don't think it would work if multiple volatility words are used for different things in the same dialect and/or word usages aren't aligned across dialects. (So in one dialect VOLATILE means X and IMMUTABLE means Y, but in another dialect VOLATILE means Y and IMMUTABLE means X.) I think resolving this will probably require reviewing volatility-related words across the dialects. I'm happy to do that, but it will take me a few days to get to it. |
self._match_text_seq("COMMIT", "PRESERVE", "ROWS") | ||
return exp.OnCommitProperty() | ||
|
||
# def _parse_unique_property(self) -> exp.Expression: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this
Convert Create args to properties in POST_CREATE location:
Convert Create args to properties in POST_EXPRESSION location:
Add preserve_rows property in POST_EXPRESSION location for ON COMMIT PRESERVE ROWS #1205
Make SetProperty unsupported in Snowflake (Teradata "CREATE MULTISET TABLE a" -> Snowflake "CREATE TABLE a") #1205