Skip to content

Commit

Permalink
cte fix and ids
Browse files Browse the repository at this point in the history
  • Loading branch information
mlorek committed Sep 17, 2024
1 parent 5d7723a commit 52c61fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
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;

0 comments on commit 52c61fa

Please sign in to comment.