Skip to content

Commit

Permalink
exclude clause (#4374)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlorek authored Jan 5, 2025
1 parent de9bc21 commit 4a95d4d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions sql/snowflake/SnowflakeLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ ESCAPE : 'ESCAPE';
ESCAPE_UNENCLOSED_FIELD : 'ESCAPE_UNENCLOSED_FIELD';
EVENT : 'EVENT';
EXCEPT : 'EXCEPT';
EXCLUDE : 'EXCLUDE';
EXCHANGE : 'EXCHANGE';
EXECUTE : 'EXEC' 'UTE'?;
EXECUTION : 'EXECUTION';
Expand Down
6 changes: 5 additions & 1 deletion sql/snowflake/SnowflakeParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -4156,7 +4156,7 @@ select_list

select_list_elem
: column_elem as_alias?
| column_elem_star
| column_elem_star exclude_clause?
// | udt_elem
| expression_elem as_alias?
;
Expand All @@ -4175,6 +4175,10 @@ object_name_or_alias
| alias DOT
;

exclude_clause
: EXCLUDE (column_name | column_list_in_parentheses)
;

as_alias
: AS? alias
;
Expand Down
4 changes: 4 additions & 0 deletions sql/snowflake/examples/select.sql
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ select *
from a;

select count(t.*) as ca from t9 as t;

SELECT a.* EXCLUDE (col1, col2), b.* EXCLUDE col3
FROM t1 as a
JOIN t2 as b USING (col5, col6);

0 comments on commit 4a95d4d

Please sign in to comment.