Bird
0
0

Which of the following is the correct way to specify a snapshot configuration in a dbt snapshots.yml file?

easy📝 Syntax Q3 of 15
dbt - Advanced Patterns
Which of the following is the correct way to specify a snapshot configuration in a dbt snapshots.yml file?
Asnapshots: - name: customer_snapshot strategy: check unique_key: customer_id check_cols: ['email', 'status']
Bmodels: - name: customer_snapshot strategy: check unique_key: customer_id check_cols: ['email', 'status']
Csnapshots: - model: customer_snapshot strategy: timestamp unique_key: customer_id updated_at: last_modified
Dsnapshots: - name: customer_snapshot type: snapshot unique_key: customer_id check_cols: ['email', 'status']
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct top-level key

    The snapshot configurations must be under the snapshots: key, not models:.
  2. Step 2: Confirm the snapshot properties

    The snapshot requires a name, strategy, unique_key, and either check_cols or updated_at depending on strategy.
  3. Step 3: Validate the syntax

    snapshots: - name: customer_snapshot strategy: check unique_key: customer_id check_cols: ['email', 'status'] correctly uses name, strategy: check, unique_key, and check_cols in the right structure.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    Snapshot configs go under snapshots: with proper keys [OK]
Quick Trick: Snapshots use 'snapshots:' key with name and strategy [OK]
Common Mistakes:
MISTAKES
  • Using 'models:' instead of 'snapshots:'
  • Using 'type' instead of 'strategy'
  • Omitting 'unique_key' in snapshot config

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes