diff options
-rw-r--r-- | examples/bigquery_view_parser.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/bigquery_view_parser.py b/examples/bigquery_view_parser.py index 6172481..86e01e5 100644 --- a/examples/bigquery_view_parser.py +++ b/examples/bigquery_view_parser.py @@ -566,6 +566,8 @@ class BigQueryViewParser: ) ) + window_select_clause = WINDOW + identifier + AS + LPAR + window_specification + RPAR + select_core = ( SELECT + Optional(DISTINCT | ALL) @@ -581,6 +583,9 @@ class BigQueryViewParser: ORDER + BY + Group(delimitedList(ordering_term))("order_by_terms") ) + + Optional( + delimitedList(window_select_clause) + ) ) grouped_select_core = select_core | (LPAR + select_core + RPAR) @@ -1492,6 +1497,20 @@ class BigQueryViewParser: [ (None, None, 'x'), ] + ], + [ + """ + WITH x AS ( + SELECT a + FROM b + WINDOW w as (PARTITION BY a) + ) + SELECT y FROM z + """, + [ + (None, None, 'b'), + (None, None, 'z') + ] ] ] |