Bird
0
0

Given this merge config:

medium📝 Debug Q7 of 15
dbt - Incremental Models

Given this merge config:

merge:
  unique_key: ['user_id']

The merge is not updating existing rows as expected. What could be wrong?

AThe target table is empty, so no rows to update
BThe merge config requires a single string, not a list
CThe merge operation requires a separate update clause
DThe unique_key column 'user_id' does not uniquely identify rows in source or target
Step-by-Step Solution
Solution:
  1. Step 1: Understand update behavior

    If unique_key does not uniquely identify rows, merge cannot match and update existing rows.
  2. Step 2: Check other options

    List syntax is valid, update clause is implicit, and target emptiness would not cause no updates but inserts.
  3. Final Answer:

    The unique_key column 'user_id' does not uniquely identify rows in source or target -> Option D
  4. Quick Check:

    Non-unique keys prevent updates in merge [OK]
Quick Trick: Ensure unique_key uniquely identifies rows to update correctly [OK]
Common Mistakes:
MISTAKES
  • Thinking list syntax is invalid for single key
  • Assuming update clause is needed explicitly
  • Ignoring uniqueness requirement of unique_key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes