Skip to main content

materialized

dbt_project.yml

Definition

Materializations are strategies for persisting dbt models in a warehouse. These are the materialization types built into dbt:

  • ephemeralephemeral models are not directly built into the database
  • table — a model is rebuilt as a table on each run
  • view — a model is rebuilt as a view on each run
  • materialized_view — allows the creation and maintenance of materialized views in the target database
  • incrementalincremental models allow dbt to insert or update records into a table since the last time that model was run

You can also configure custom materializations in dbt. Custom materializations are a powerful way to extend dbt's functionality to meet your specific needs.

Creation precedence

Materializations are implemented following this "drop through" life cycle:

  1. If a model does not exist with the provided path, create the new model.
  2. If a model exists, but has a different type, drop the existing model and create the new model.
  3. If --full-refresh is supplied, replace the existing model regardless of configuration changes and the on_configuration_change setting.
    • BigQuery users may need to run dbt run --full-refresh (instead of dbt run) after changing a model’s materialization (for example, from table to view) to ensure dbt fully replaces the existing relation and the change is fully applied.
  4. If there are no configuration changes, perform the default action for that type (e.g. apply refresh for a materialized view).
  5. Determine whether to apply the configuration changes according to the on_configuration_change setting.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading