Skip to content

Commit

Permalink
[Snowflake] Add new features and tags test (#3845)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlorek authored Nov 24, 2023
1 parent 3564c63 commit 35e683d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sql/snowflake/SnowflakeParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ clustering_action
;

table_column_action
: ADD COLUMN? column_name data_type
: ADD COLUMN? if_not_exists? column_name data_type
default_value?
inline_constraint?
( WITH? MASKING POLICY id_ ( USING '(' column_name COMMA column_list ')' )? )?
Expand All @@ -1154,7 +1154,7 @@ table_column_action
| alter_modify COLUMN column_name UNSET MASKING POLICY
| alter_modify column_set_tags (COMMA column_set_tags)*
| alter_modify column_unset_tags (COMMA column_unset_tags)*
| DROP COLUMN? column_list
| DROP COLUMN? if_exists? column_list
;

inline_constraint
Expand Down Expand Up @@ -2490,7 +2490,7 @@ create_tag
;

tag_allowed_values
: ALLOWED_VALUES tag_value (COMMA tag_value)*
: ALLOWED_VALUES string_list
;

session_parameter
Expand Down
4 changes: 4 additions & 0 deletions sql/snowflake/examples/tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
create table t(i int);

alter table t add column if not exists j int;
alter table t drop column if exists i;
3 changes: 3 additions & 0 deletions sql/snowflake/examples/tags.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
create tag sch.tag1 allowed_values 'a', 'b';
create tag db.sch.tag2 allowed_values 'a', 'b' comment = '';
create tag tag3 comment = '';

0 comments on commit 35e683d

Please sign in to comment.