Interview practice question
Unique test failing on primary key
Data Engineering · dbt · Beginner
The unique test on customer_id in dim_customers starts failing. How do you investigate?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Query the duplicate keys and look at the full rows.
- Check if duplicates come from the source or a join in the model.
- Common causes: source sent duplicates, a join fans out, or an SCD table is joined without a current filter.
- Fix at the right layer, often staging with dedup logic.
- Store failures to speed up future investigations.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.