Sam Ngo
Sam Ngo

Reputation: 53

BigQuery Table Decorators with Standard SQL

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>`

Notes:

UPDATE:

As Mikhail pointed out, this feature is not available for Standard SQL. It has been requested here.

Upvotes: 5

Views: 7409

Answers (2)

Felipe Hoffa
Felipe Hoffa

Reputation: 59175

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';

Upvotes: 10

Mikhail Berlyant
Mikhail Berlyant

Reputation: 172974

Support for table decorators in standard SQL is planned but not yet implemented. To view the details of the feature request, see: BigQuery feature request tracker. You can click the Vote for this issue and get email notifications icon (the star) to register your support for the feature.

See more at https://cloud.google.com/bigquery/table-decorators

Upvotes: 1

Related Questions