summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2019-09-25 18:31:54 -0500
committerptmcg <ptmcg@austin.rr.com>2019-09-25 18:31:54 -0500
commit3e5b2660c47d5ba50781bfbcdf291a1f829b9a88 (patch)
tree1d892e136c24d23bb301beddb3ed6815b559448e
parenta3c11d6054c2b84492e8551bd95b9eb936ae4aa2 (diff)
parente02ba7389eeca1743838665f3ec43c849afb7ce7 (diff)
downloadpyparsing-git-3e5b2660c47d5ba50781bfbcdf291a1f829b9a88.tar.gz
Merge remote-tracking branch 'origin/master'
-rw-r--r--examples/bigquery_view_parser.py19
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')
+ ]
]
]