Skip to content

Commit

Permalink
Add any order for dynamic table params and some keyword exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKuat committed Aug 14, 2024
1 parent 4981ce3 commit edc12a0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions sql/snowflake/SnowflakeParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -1583,14 +1583,19 @@ compression
: COMPRESSION EQ compression_type
;

//TODO : Check and allow options reorder
//(ie DATA_RETENTION_TIME_IN_DAYS could be before or after REFRESH_MODE and so on)
create_dynamic_table
: CREATE or_replace? TRANSIENT? DYNAMIC TABLE if_not_exists? object_name (
LR_BRACKET materialized_col_decl_list RR_BRACKET
)? dynamic_table_settable_params+ (REFRESH_MODE EQ (AUTO | FULL | INCREMENTAL))? (
INITIALIZE EQ ( ON_CREATE | ON_SCHEDULE )
)? cluster_by? with_row_access_policy? with_tags? AS query_statement
)? dynamic_table_params+ AS query_statement
;

dynamic_table_params
: dynamic_table_settable_params
| REFRESH_MODE EQ (AUTO | FULL | INCREMENTAL)
| INITIALIZE EQ ( ON_CREATE | ON_SCHEDULE )
| cluster_by
| with_row_access_policy
| with_tags
;

dynamic_table_settable_params
Expand Down Expand Up @@ -3605,8 +3610,11 @@ non_reserved_words
| DOWNSTREAM
| DYNAMIC
| EDITION
| ENABLED
| EMAIL
| EMPTY_
| EVENT
| EXCHANGE
| EXPIRY_DATE
| EXPR
| FIRST_NAME
Expand Down

0 comments on commit edc12a0

Please sign in to comment.