Badruddin Kamal
Badruddin Kamal

Reputation: 113

Adding multiple partitioned columns to BigQuery table from SQL query

I've been trying to add multiple partition columns, to a BigQuery table, but it seems to only take one field, even if I add multiple partition fields in the query parameters.

I'm partitioning by date time and integer range.

It only takes the later of the pair to create partitions and ignores the first partition field.

Any ideas, would be appreciated?

Upvotes: 10

Views: 15345

Answers (2)

Nhung Nguyen
Nhung Nguyen

Reputation: 11

I use coalesce to combine the columns and partition the new field created from coalesce, worked for my purpose.

Upvotes: 1

Hua Zhang
Hua Zhang

Reputation: 1551

BigQuery only supports partitioning on one column. If you want to partition on multiple columns, you can consider partitioning+clustering. The table can be clustered on up to 4 columns.

Upvotes: 14

Related Questions