Skip to content

Commit

Permalink
Added another test case to bigquery_view_parser.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ptmcg committed Apr 30, 2022
1 parent ed37b35 commit 0ec8031
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/bigquery_view_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,30 @@ def print_(*args):
(None, 'bigquery-public-data:samples', 'natality'),
],
],
[
"""\
SELECT
/* Replace white spaces in the title with underscores. */
REGEXP_REPLACE(title, r'\s+', '_') AS regexp_title, revisions
FROM
(SELECT title, COUNT(revision_id) as revisions
FROM
[bigquery-public-data:samples.wikipedia]
WHERE
wp_namespace=0
/* Match titles that start with 'G', end with
* 'e', and contain at least two 'o's.
*/
AND REGEXP_MATCH(title, r'^G.*o.*o.*e$')
GROUP BY
title
ORDER BY
revisions DESC
LIMIT 100);""",
[
(None, 'bigquery-public-data:samples', 'wikipedia'),
],
],
[
"""\
SELECT
Expand Down

0 comments on commit 0ec8031

Please sign in to comment.