Skip to content

Sampling a model run before a full build

The --sample flag puts a dbt invocation into 'sample mode,' filtering input data to a limited, relative time window so developers can build or test models faster during local development and CI without processing full production volumes. It uses each model's configured event_time (the same field used for microbatch incremental models) to determine which rows to include.

Must-know

  • Sample mode filters rows based on the model's (and its sources'/seeds') configured event_time column; models without event_time set are not sampled and run against their full dataset.
  • You invoke it as part of a normal invocation, e.g. dbt run --sample=<relative_time_range> or dbt build --sample=<relative_time_range>, restricting data to that recent window relative to the current run time.
  • Sample mode is meant for development and CI workflows to speed up iteration, not for production runs, since it intentionally works on incomplete data.
  • Because upstream data is truncated, downstream tests (row counts, uniqueness, referential integrity, etc.) can behave differently or fail compared to running against full data.
  • Sample mode combines with normal node selection (--select/--exclude), so you can scope both which models run and how much data each processes for fast local cycles.
  • It only affects what data is read/processed during that invocation—it does not modify or truncate your actual source tables or persist any sampling logic into the model's compiled SQL.
Check this objectiveFree · always available

What is the primary purpose of running dbt build with the --sample flag?

Your objective map0 tried · 0 right · 31 untouched

What you have tried across dbt Analytics Engineering's objectives, not a readiness score.

Coverage checked against the published exam guide on Aug 5, 2026.

These are independent practice questions, written against this certification's published exam guide. They are not the certification vendor's own questions, and not the real exam.