klahnakoski / mo-sql-parsing

Let's make a SQL parser so we can provide a familiar interface to non-sql datastores!
Mozilla Public License 2.0
255 stars 58 forks source link

Exception when parsing a query that uses BigQuery point-in-time feature #208

Closed fireis closed 10 months ago

fireis commented 10 months ago

Hello, when parsing a BigQuery query that uses the point-in-time feature (https://cloud.google.com/bigquery/docs/access-historical-data#query_data_at_a_point_in_time), the parser throws a ParseException. The following code snippet allows us to reproduce the behavior:

SELECT *
FROM `mydataset.mytable`
  FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR);

This snippet generates the following exception: ParseException: Expecting {update} | {share} | {no} | {key}, found "SYSTEM_TIM" (at char 41), (line:4, col:7)

klahnakoski commented 10 months ago

https://github.com/klahnakoski/mo-sql-parsing/commit/64d6966f86a32e694877bcd499f118fb6eb57ca7

klahnakoski commented 10 months ago

https://pypi.org/project/mo-sql-parsing/9.460.23319/