Bird
0
0

Given the following dbt command run twice with changes in model 'sales':

medium📝 Predict Output Q13 of 15
dbt - Production Deployment
Given the following dbt command run twice with changes in model 'sales':
dbt run --state ./target/run1 --select state:modified
# After modifying 'sales' model
 dbt run --state ./target/run1 --select state:modified

What will the second command do?
ARun only the 'sales' model because it was modified
BRun all models again ignoring state
CRun no models because nothing changed
DThrow an error due to incorrect state path
Step-by-Step Solution
Solution:
  1. Step 1: Understand the first run

    The first command runs all models and saves state in ./target/run1.
  2. Step 2: Analyze the second run with modification

    The second command compares current state to ./target/run1 and runs only models that changed, here 'sales'.
  3. Final Answer:

    Run only the 'sales' model because it was modified -> Option A
  4. Quick Check:

    Modified model runs only [OK]
Quick Trick: Second run runs only changed models using saved state [OK]
Common Mistakes:
MISTAKES
  • Assuming all models run again
  • Thinking no models run if only one changed
  • Confusing state path usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes