Bird
0
0

Consider this snapshot config:

medium📝 Predict Output Q5 of 15
dbt - Advanced Patterns
Consider this snapshot config:
snapshots:
  - name: product_snapshot
    strategy: check
    unique_key: product_id
    check_cols: ['price', 'description']

What triggers a new snapshot record?
ASnapshot updates only on timestamp changes
BAny change in 'price' or 'description' columns
CAll columns must change to trigger snapshot
DOnly changes in 'product_id'
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'check' strategy in snapshots

    The 'check' strategy creates a new record if any column in check_cols changes.
  2. Step 2: Evaluate options

    Any change in 'price' or 'description' columns matches this behavior. Only changes in 'product_id' is wrong because unique_key identifies records but does not trigger snapshots. All columns must change to trigger snapshot is false; not all columns must change. Snapshot updates only on timestamp changes applies to timestamp strategy, not check.
  3. Final Answer:

    Any change in 'price' or 'description' columns -> Option B
  4. Quick Check:

    Check strategy triggers on specified column changes [OK]
Quick Trick: Check strategy snapshots on specified column changes [OK]
Common Mistakes:
MISTAKES
  • Confusing unique_key with change trigger
  • Assuming all columns must change
  • Mixing timestamp and check strategies

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes