1

We are trying to perform a merge 1 day of a date-partitioned table. We've followed google's recommended merge setup:

MERGE dataset.target T
USING (SELECT * FROM dataset.source WHERE _PARTITIONTIME = '2018-01-01') S
ON T.c1 = S.c1
WHEN MATCHED THEN
 DELETE

We even put an extra piece of query into the when statement:

WHEN MATCHED and tgt._PARTITIONTIME = '2018-01-01' THEN

Running this query results in BQ querying our entire table instead of hitting only a single day.

Running the same query without the MERGE statement only hits 1 day of data as expected. We are wondering if anything changed on BQs side, since we made no changes to our datastructure whatsoever.

Cheers,

Lars Boers
  • 11
  • 1

0 Answers0