Bird
0
0

Consider this dbt merge config snippet:

medium📝 Debug Q14 of 15
dbt - Incremental Models

Consider this dbt merge config snippet:

merge:
  unique_key: ['id']

But the source data has duplicate id values. What is the likely issue?

AMerge will fail or produce incorrect results due to non-unique keys
BMerge will ignore duplicates and update only one row
CMerge will create new columns for duplicates
DMerge will automatically remove duplicates before merging
Step-by-Step Solution
Solution:
  1. Step 1: Identify problem with non-unique keys in merge

    Unique_key must uniquely identify rows. If duplicates exist, dbt cannot correctly match rows.
  2. Step 2: Understand merge behavior with duplicates

    Duplicates cause merge to fail or produce wrong updates because dbt doesn't know which row to update.
  3. Final Answer:

    Merge will fail or produce incorrect results due to non-unique keys -> Option A
  4. Quick Check:

    Non-unique keys cause merge failure = A [OK]
Quick Trick: unique_key must be unique; duplicates cause merge errors [OK]
Common Mistakes:
MISTAKES
  • Assuming merge ignores duplicates silently
  • Thinking merge creates new columns for duplicates
  • Believing merge auto-removes duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes