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 - cte fix and ids #4245

Merged
merged 1 commit into from
Sep 17, 2024
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
4 changes: 4 additions & 0 deletions sql/snowflake/SnowflakeParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -3644,6 +3644,7 @@ non_reserved_words
| NAME
| NETWORK
| OFFSET
| OLD
| ON_CREATE
| ON_ERROR
| ON_SCHEDULE
Expand Down Expand Up @@ -3681,6 +3682,7 @@ non_reserved_words
| SCALE
| SECURITYADMIN
| SOURCE
| START_DATE
| STATE
| STATS
| SYSADMIN
Expand Down Expand Up @@ -3953,6 +3955,7 @@ asc_desc
over_clause
: OVER '(' partition_by order_by_expr? ')'
| OVER '(' order_by_expr ')'
| OVER '(' ')'
;

function_call
Expand Down Expand Up @@ -4084,6 +4087,7 @@ select_statement_in_parentheses
: LR_BRACKET select_statement_in_parentheses RR_BRACKET
| select_statement_in_parentheses set_operators
| select_statement
| with_expression
;

select_optional_clauses
Expand Down
16 changes: 16 additions & 0 deletions sql/snowflake/examples/select.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,19 @@ union
(((select 10 as c)))
union
((select 11 as d));

SELECT SUM(cs) OVER() AS ta FROM t;

SELECT old, start_date from t;


with a as (
with b as (
select 't' as c
)
(select * from b)
union
(select * from b)
)
select *
from a;
Loading