Skip to content
RevOps Agentified

Google BigQuery

Apply a late correction to one BigQuery service-date partition and verify the merge, duplicate checks and read cost.

Apply a correction to the original service date
Late correction
November 20 delivery changes a November 14 amount to $125.
Merge partition
Match one source row to one subscription-day key.
Verify
Check the older partition and replay without increasing row count.

A billing correction arrives today for a subscription-day record from last week. The daily revenue model must update the affected service date without appending a duplicate or scanning the full destination table. Build the BigQuery merge around the event’s service date and stable row key.

Scope the merge to the affected partitions

For a table partitioned by service_date, prepare a source query containing the affected dates and one approved input row per subscription and service date. Use the same key in the BigQuery MERGE. Include the partition filter where BigQuery can apply it to the source and target. Check the query plan and processed bytes rather than assuming the optimizer scanned only the intended partitions.

Suppose subscription A for November 14 originally shows $120. The authoritative correction is $125 and arrives November 20. Send it to the November 14 partition. Exclude or reject conflicting inputs before merging. In BigQuery, certain updating merge clauses return an error if multiple source rows match the same target row.

Check the late row and the partition check together

Three checks for a subscription-day correction
TestExpected resultEvidence
Apply the November 14 correction.One row for subscription A on November 14 now contains $125.Row key and destination value.
Replay the correction.Row count and amount remain the same.Compare the target key before and after the replay.
Run the query against representative partitions.The corrected period is included. Unrelated partitions stay unchanged.Query plan, processed bytes and before/after partition totals.

If valid corrections can arrive earlier than the normal processing window, define an explicit backfill path for them. The reconciliation guide covers how to report corrections that were not applied.

Test the Google BigQuery example

Use these inputs to predict the result. Check your answer against the guide.

Test
Run the query against representative partitions.
Check the expected result
Expected result
The corrected period is included. Unrelated partitions stay unchanged.
Evidence
Query plan, processed bytes and before/after partition totals.

Compare with another case

Test
Apply the November 14 correction.
Expected result
One row for subscription A on November 14 now contains $125.

GTM Systems Academy newsletter

Get guides to CRM ownership, integrations, and migrations, with checks to run before you change your stack.