BigQuery table partitioning by month

Asked at 2017-01-11 07:39:45Z
  • 5 Subscribers
  • 114 Views
1

I can't find any documentation relating to this. Is time_partitioning_type=DAY the only way to partition a table in BigQuery? Can this parameter take any other values besides a date?


2 answers in total

1
Graham Polley Posted at 2017-01-11 08:50:00Z

Unfortunately not. BigQuery currently only supports date-partitioned tables.

https://cloud.google.com/bigquery/docs/partitioned-tables

BigQuery offers date-partitioned tables, which means that the table is divided into a separate partition for each date

0
Elliott Brossard Posted at 2017-01-11 14:30:00Z

Note that even if you partition on day granularity, you can still write your queries to operate at the level of months using an appropriate filter on _PARTITIONTIME. For example,

#standardSQL
SELECT * FROM MyDatePartitionedTable
WHERE DATE_TRUNC(EXTRACT(DATE FROM _PARTITIONTIME), MONTH) = '2017-01-01';

This selects all rows from January of this year.

Answer this questsion