How would you query specific partitions in a BigQuery table?
A.
Use the DAY column in the WHERE clause
B.
Use the EXTRACT(DAY) clause
C.
Use the __PARTITIONTIME pseudo-column in the WHERE clause
D.
Use DATE BETWEEN in the WHERE clause
The Answer Is:
C
This question includes an explanation.
Explanation:
Partitioned tables include a pseudo column named _PARTITIONTIME that contains a date-based timestamp for data loaded into the table. To limit a query to particular partitions (such as Jan 1st and 2nd of 2017), use a clause similar to this:
WHERE _PARTITIONTIME BETWEEN TIMESTAMP('2017-01-01') AND TIMESTAMP('2017-01-02')