Bird
0
0

Given this snapshot config:

medium📝 Predict Output Q4 of 15
dbt - Advanced Patterns
Given this snapshot config:
snapshots:
  - name: order_snapshot
    strategy: timestamp
    unique_key: order_id
    updated_at: last_updated

What happens when last_updated changes for an order?
ANo change is recorded unless order_id changes
BThe existing record is overwritten without history
CSnapshot fails due to missing primary key
DA new record version is created with updated data
Step-by-Step Solution
Solution:
  1. Step 1: Understand timestamp strategy behavior

    When the updated_at column changes, dbt creates a new snapshot record version.
  2. Step 2: Analyze options

    A new record version is created with updated data correctly describes new version creation. The existing record is overwritten without history is false because history is kept. No change is recorded unless order_id changes ignores timestamp changes. Snapshot fails due to missing primary key is incorrect; unique_key is provided.
  3. Final Answer:

    A new record version is created with updated data -> Option D
  4. Quick Check:

    Timestamp strategy tracks updates by new versions [OK]
Quick Trick: Timestamp strategy creates new versions on updated_at changes [OK]
Common Mistakes:
MISTAKES
  • Thinking snapshots overwrite old data
  • Ignoring updated_at column role
  • Confusing unique_key with updated_at

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes