dbt full refresh: Managing Full Refreshes in dbt
In dbt, the full_refresh
configuration allows you to control whether models and seeds should fully refresh during a dbt run
or dbt seed
command. This setting specifies refresh behavior for specific resources within your dbt project.
Configuring Full Refresh for Models
You can set the full_refresh
option in dbt_project.yml
or directly within model SQL files to manage refresh behavior:
Full Refresh for Seeds
Seeds can also be configured to ignore the --full-refresh
flag:
Full Refresh Logic
true
: Resource always full-refreshes with --full-refresh.false
: Resource never full-refreshes, regardless of --full-refresh flag.none
or omitted: Follows the --full-refresh flag behavior.
Rebuilding Incremental Models
To force a full refresh on incremental models when logic changes:
_10$ dbt run --full-refresh --select incremental_model_name
Handling Schema Changes in Incremental Models
Use on_schema_change
in incremental models to manage schema modifications:
Options for on_schema_change
:
ignore
: Default behavior continues.fail
: Errors out if schemas differ.append_new_columns
: Adds new columns without removing absent ones.sync_all_columns
: Adds and removes columns, including data type changes.
Manage Sources and dbt Models in one place
Build end-to-end pipelines using a single framework.
Get Started