state config uses the same names as dbt™ State, so a project configured for dbt™ State carries over.
state config
Set state on models and snapshots in dbt_project.yml, in a properties file, or in a model’s config() block. All keys are optional.
How lag_tolerance works
lag_tolerance compares times on the upstream data, not the time since the node last built. An upstream counts as new once its data changed more than lag_tolerance after the version the node was last built from. For example, with lag_tolerance: 45m:
A node that skips keeps comparing against the version it was built from, so smaller changes add up: once the upstream has moved more than 45 minutes past that version, the node rebuilds. If the upstream changes only once, by less than the tolerance, the node keeps its current data until the upstream changes again.
For a node that should follow every upstream change, use
lag_tolerance: 0s. A change to the node’s own logic, or to an upstream node that builds in the same run, rebuilds it whatever the tolerance.
evaluate_volatile_sql
Volatile functions return a different value on each run, for example current_date, current_timestamp, now(), and random().
false(default): the function call counts as part of the logic, but its value doesn’t. A model that filters oncurrent_datecan be reused on a later day, as long as nothing else changed.true: the value counts. A model that usescurrent_daterebuilds once a day, and one that usescurrent_timestamp,now(),random(), or a UUID function rebuilds on every run.
compare_unrendered_code
With compare_unrendered_code on, a node rebuilds for a logic change only when both its Jinja template and its rendered SQL changed. Use it for models whose rendered SQL differs on every run, for example because of a var(), an env_var(), or run_started_at, so they stop rebuilding on every run.
dbt™ 2.0 doesn’t accept compare_unrendered_code under state, so set it under meta:
Not supported
execute_hooks_on_any_reuse. Pre-hooks and post-hooks don’t run for a node that’s skipped.- dbt™ State’s profile settings (
allow_clones,metadata_warehouse, anddefer_to_target). Paradime writes the dbt™ profile for your runs, so usePARADIME_STATE_ALLOW_CLONESinstead ofallow_clones. For deferral, use Bolt’s Defer to a previous run or the Code IDE’s Defer selector.
Source freshness
Paradime State detects new data from warehouse table metadata. For a source whose metadata doesn’t change when data lands, declare a freshness column withloaded_at_field, or a query that returns the latest load time with loaded_at_query. When either is set, Paradime State uses it instead of the table metadata.
models/sources.yml
What counts as a change
A node rebuilds when any of these differ from its last successful build:- Its compiled SQL, compared in a normalized form so that whitespace and formatting don’t count.
- Its materialization and incremental strategy.
- The SQL of the views it reads from.
- Any of these configurations, even when the SQL is identical:
- Models and tests:
on_schema_change,full_refresh,incremental_predicates,merge_update_columns,merge_exclude_columns,partition_by,cluster_by,partitions,partition_expiration_days,transient,contract,constraints,file_format,location_root,liquid_clustered_by,tblproperties,severity,error_if,warn_if,where,limit,fail_calc,store_failures, andstore_failures_as. - Snapshots, in addition:
strategy,updated_at,check_cols,unique_key,hard_deletes,invalidate_hard_deletes,dbt_valid_to_current, andsnapshot_meta_column_names. - Seeds: the CSV file’s contents,
column_types,quote_columns, anddelimiter.
- Models and tests:
meta, tags, docs, grants, group, or hooks don’t count.
Environment variables
Set these likePARADIME_STATE_ENABLED, in the Default, Bolt, or Code IDE box of Settings > Environment Variables (see Turn on Paradime State). Bolt picks up changes when it next parses your schedules. 1, true, yes, and on mean on; 0, false, no, and off mean off.
Paradime connects each run to Paradime State for you, so these are the only variables you set.
Force a rebuild
- Change the node’s SQL or one of the configurations that count as a change.
- Run
dbt run --full-refreshto rebuild the selected incremental models from scratch, as you would without Paradime State. Tables and views keep their usual decision, because a full refresh builds them the same way. - Set
PARADIME_STATE_DISABLEDto1for a plain dbt™ run. See Turn it off.
Next steps
Read a Paradime State run
See what each run skipped, cloned, and built.
Troubleshoot Paradime State
Why a node rebuilt, or didn’t.