sql-parser-cst
sql-parser-cst copied to clipboard
Support BigQuery pipe syntax
See: https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax
In summary, the pipe syntax allows expressing the following SQL:
SELECT item, COUNT(*) AS num_items, SUM(sales) AS total_sales
FROM Produce
WHERE
item != 'bananas'
AND category IN ('fruit', 'nut')
GROUP BY item
ORDER BY item DESC;
as:
FROM Produce
|> WHERE
item != 'bananas'
AND category IN ('fruit', 'nut')
|> AGGREGATE COUNT(*) AS num_items, SUM(sales) AS total_sales
GROUP BY item
|> ORDER BY item DESC;