Skip to content
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

snowflake - exclude clause #4374

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Loading