BigQuery: Saving query result to partitioned table using cloud client

时间:2018-07-16 15:26:47

标签: google-cloud-platform google-bigquery

I am currently using following client as suggested in BigQuery documentation com.google.cloud:google-cloud-bigquery:1.36.0

Looks like specifying time partitioning for destination table is not yet supported in this client. Is this expected or do I need to use old client com.google.apis:google-api-services-bigquery to use this feature?

1 个答案:

答案 0 :(得分:2)

您不需要在客户端中设置特定的属性。使用CREATE TABLE AS SELECT DDL statement,例如:

CREATE TABLE dataset.new_table
PARTITION BY DATE(timestamp_column) AS
SELECT x, y, z, timestamp_column
FROM dataset.existing_table