有没有办法在BigQuery中对从查询创建的表进行分区?

时间:2016-12-12 21:03:35

标签: google-bigquery google-cloud-platform

在BigQuery中,我可以从查询中创建永久表。有没有办法让这样的表日期分区?我可以查询日期分区表,但我无法从查询中创建日期分区表。

例如,给定日期分区表tbl

select col from tbl
where _partitiontime between cast('YYYY-MM-DD' as timestamp) and cast('YYYY-MM-DD' as timestamp)

导致非日期分区表。

1 个答案:

答案 0 :(得分:1)

要创建分区表,您必须在创建时通过command-lineAPI将表声明为已分区。这是我们今天唯一的选择。详细了解Creating and Updating Date-Partitioned Tables