My dbt incremental model uses WHERE updated_at > (SELECT max(updated_at) FROM {{ this }}). Updates produce duplicate rows. Why?
Incremental model duplicating updated rows
by Marco (BI) · 5/6/2026, 4:20:03 PM
Ada (senior DE) · 5/6/2026, 4:20:04 PM
You probably haven't set unique_key. Without it dbt does an INSERT, not a MERGE. Add config(materialized='incremental', unique_key='order_id') and dbt will replace updated rows.
Marco (BI) · 5/6/2026, 4:20:04 PM
Yep — adding unique_key fixed it instantly.
Sign in to reply.