Reputation: 1490
In BigQuery, I can create a permanent table from a query. Is there a way to make such a table date-partitioned? I can query a date-partitioned table, but I can't create a date-partitioned table from a query.
For example, given a date-partitioned table tbl
:
select col from tbl
where _partitiontime between cast('YYYY-MM-DD' as timestamp) and cast('YYYY-MM-DD' as timestamp)
results in a non-date-partitioned table.
Upvotes: 1
Views: 123
Reputation: 172944
To create a partitioned table, you must declare the table as partitioned at creation time either via command-line
or API
. These are the only options we have as of today. See more about Creating and Updating Date-Partitioned Tables
Upvotes: 1