BigQuery MERGE Is Not a Uniqueness Constraint: A Replay-Safe Tutorial
A MERGE can be atomic and still leave duplicate business keys. The missing ingredient is a clear key and version contract. This tutorial builds a current-state orders table, not an event-history table. One row represents one order_id . It assumes a single writer and a source-provided, monotonically increasing integer version per order. Timestamps alone are not that contract. Why the obvious MERGE…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.