I'm having some trouble using table decorators using Standard SQL. However, the same concept with Legacy SQL syntax works for me. Is this a bug? Here is an example.
(A) The following query works without any issue
SELECT COUNT(*) FROM [some-project-name:some_dataset.some_table_name@<time1>-<time2>]
(B) The following query returns back with an error message
Error: Table "some-project-name.some_dataset.some_table_name@<time1>-<time2>" cannot include decorator
SELECT COUNT(*) FROM `some-project-name.some_dataset.some_table_name@<time1>-<time2>`
<time1>
is absolute and is the creation time in of the table in milliseconds since Unix epoch.<time2>
is the current time stamp in millisecondsAs Mikhail pointed out, this feature is not available for Standard SQL. It has been requested here.
BigQuery supports the Google Standard SQL dialect, but a legacy SQL dialect is also available. If you are new to BigQuery, you should use Google Standard SQL as it supports the broadest range of functionality. For example, features such as DDL and DML statements are only supported using Google Standard SQL.
Google BigQuery is a cloud-based architecture that has a scalable architecture with a relational RDBMS structure. It follows ANSI SQL standard and allows users to create, delete and update data in Google BigQuery.
The main differences Additionally, the standard dialect has a smaller range of valid values of type TIMESTAMP compared to legacy SQL. The former only accepts values in the range in between 0001-01-01 00:00:00.000000 and 9999-12-31 23:59:59.999999 .
You can use table decorators in legacy SQL to perform a more cost-effective query of a subset of your data. Table decorators can be used whenever a table is read, such as when copying a table, exporting a table, or listing data using tabledata.
Good news: it's now implemented.
https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax
SELECT *
FROM t
FOR SYSTEM TIME AS OF '2017-01-01 10:00:00-07:00';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With