Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 583
Badruddin Kamal Avatar asked Jul 14 '20 00:07

Badruddin Kamal


People also ask

Can I partition by multiple columns in BigQuery?

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.

How would you query specific partitions in a BigQuery table?

If you want to query data based on a time zone other than UTC, choose one of the following options: Adjust for time zone differences in your SQL queries. Use partition decorators to load data into specific ingestion-time partitions, based on a different time zone than UTC.


Video Answer


1 Answers

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.

like image 152
Hua Zhang Avatar answered Oct 24 '22 01:10

Hua Zhang