Deterministic Deduplication & Merge
Turn duplicated source records into a repeatable winner-selection flow with explicit identity, source priority and tie-break rules.
Evidence tier describes my hands-on relationship with the content. Official sources describe platform contracts/documentation. Production observations should not automatically be treated as official limits.
A deduplicated staging dataset whose winning row is explainable and repeatable across runs.
Define the logical identity key.
Define authoritative source precedence when multiple systems disagree.
Choose stable tie-break fields.
State the output grain
Write down exactly what one output row represents before touching SQL.
Rank within the identity
Use ROW_NUMBER() with the business identity in PARTITION BY.
Encode business precedence
If one source is more authoritative, make that rule explicit before recency.
Add a deterministic tie-breaker
A timestamp alone is not enough if two rows can share the same value.
Inspect discarded rows
Validate rn = 2 / rn > 1 before promoting the winner logic to production.
Stage before destructive writes
Prefer a reviewable staging output before Add/Update or overwrite into a critical target.
Turn the Recipe into checkable work.
Progress, notes and history stay in this browser.