Bird
0
0

Given this snapshot config snippet:

medium📝 Predict Output Q13 of 15
dbt - Advanced Patterns
Given this snapshot config snippet:
snapshots:
  - name: customer_snapshot
    strategy: check
    check_cols: ['email', 'status']

What happens when the email or status changes in the source data?
AThe snapshot process ignores changes in these columns
BThe existing record is overwritten without history
CA new record version is created in the snapshot table
DAn error occurs because check_cols is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'check' strategy with check_cols

    The 'check' strategy tracks changes in specified columns and creates new versions when they change.
  2. Step 2: Apply to given columns

    If 'email' or 'status' changes, dbt adds a new record version to keep history.
  3. Final Answer:

    A new record version is created in the snapshot table -> Option C
  4. Quick Check:

    Check strategy tracks column changes = new version [OK]
Quick Trick: Check strategy creates new versions on column changes [OK]
Common Mistakes:
MISTAKES
  • Thinking existing records get overwritten
  • Believing changes are ignored
  • Assuming check_cols is not valid syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes