Dry-running a model to check its logic and schema before a real build
The --empty flag lets you dry-run dbt build or dbt run by replacing all ref() and source() calls with a limit-0 query, so models execute against your warehouse and validate SQL syntax, dependency logic, and schema definitions without processing any actual row data. This makes it a fast, low-cost way to confirm that models compile and run correctly before wasting time or warehouse credits on full builds.
1 · Learn the must-know
- Running dbt run --empty or dbt build --empty replaces referenced tables/views with an empty (limit 0) subquery, so the query plan is validated but no real data is scanned.
- This is the fastest way to catch SQL syntax errors, broken refs/sources, and column-level schema mismatches before running a full, expensive build.
- Because zero rows are returned, --empty is not suitable for validating actual data quality, business logic correctness on real values, or data-dependent tests.
- Materializations that depend on data volume or actual row content (like incremental logic branching or certain snapshot behaviors) may not fully validate with --empty since underlying tables might be empty or the run may take specific empty-input code paths.
- The flag works with dbt run and dbt build, and combining it with dbt test is not meaningful since tests generally require real data to assert against.
- Using --empty is a recommended CI/CD or pre-merge practice to quickly verify model compilation and schema before running full or slice-based production-scale builds.
2 · Check your understanding
Check this objectiveFree · always available
When you run dbt run --empty on a model, what happens to the ref() and source() calls inside that model's SQL?
Your objective map0 tried · 0 answered correctly · 31 untouched
What you have tried across dbt Analytics Engineering's objectives, not a readiness score.
Developing and optimizing dbt models45.16% of the exam*0 of 14 tried
Managing dbt models governance9.68% of the exam*0 of 3 tried
Debugging data modeling errors16.13% of the exam*0 of 5 tried
Troubleshooting and optimizing dbt pipelines6.45% of the exam*0 of 2 tried
Implementing dbt tests9.68% of the exam*0 of 3 tried
Implementing and maintaining external dependencies6.45% of the exam*0 of 2 tried
Leveraging the dbt state6.45% of the exam*0 of 2 tried
* Our estimate. dbt Labs publishes no section weights.
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.