-
Notifications
You must be signed in to change notification settings - Fork 627
Snowflake: CREATE DYNAMIC TABLE #1960
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
base: main
Are you sure you want to change the base?
Conversation
tests/sqlparser_snowflake.rs
Outdated
fn parse_create_dynamic_table() { | ||
snowflake().verified_stmt(r#"CREATE OR REPLACE DYNAMIC TABLE my_dynamic_table TARGET_LAG='20 minutes' WAREHOUSE=mywh AS SELECT product_id, product_name FROM staging_table"#); | ||
snowflake() | ||
.parse_sql_statements( |
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.
For the usages of parse_sql_statements
can we instead use snowflake().one_statement_parses_to(sql, canonical)
in the cases that verified_stmt
isnt applicable?
@@ -1104,6 +1066,56 @@ fn parse_sf_create_table_or_view_with_dollar_quoted_comment() { | |||
); | |||
} | |||
|
|||
#[test] | |||
fn parse_create_dynamic_table() { |
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.
Can we include scenarios for the BEFORE
and RefreshMode
variants? those don't seem to be covered by the existing tests?
c314bdd
to
e6dbd03
Compare
"CREATE DYNAMIC TABLE my_dynamic_table", | ||
" TARGET_LAG='DOWNSTREAM'", | ||
" WAREHOUSE=mywh", | ||
" REFRESH_MODE=AUTO", |
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.
Can we add similar coverage for REFRESH_MODE=FULL
and REFRESH_MODE=INCREMENTAL
?
Added support for
CREATE DYNAMIC TABLE
in Snowflake:CreateTableBuilder
with new optionsCreateTableBuilder::validate_schema_info
function and related tests because, in my opinion, it introduces semantic validation, which is out of scope for the parser.