diff options
author | ptmcg <ptmcg@austin.rr.com> | 2019-09-25 18:31:54 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2019-09-25 18:31:54 -0500 |
commit | 3e5b2660c47d5ba50781bfbcdf291a1f829b9a88 (patch) | |
tree | 1d892e136c24d23bb301beddb3ed6815b559448e | |
parent | a3c11d6054c2b84492e8551bd95b9eb936ae4aa2 (diff) | |
parent | e02ba7389eeca1743838665f3ec43c849afb7ce7 (diff) | |
download | pyparsing-git-3e5b2660c47d5ba50781bfbcdf291a1f829b9a88.tar.gz |
Merge remote-tracking branch 'origin/master'
-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') + ] ] ] |