dbt - Documentation

Snowflake specific configurations

New in v0.13.0

The transient config for Snowflake tables was added in dbt v0.13.0. For upgrading instructions, consult the docs

Transient tables

Snowflake supports the creation of transient tables. Snowflake does not preserve a history for these tables, which can result in a measurable reduction of your Snowflake storage costs. Note however that transient tables do not participate in Time Travel. Weigh these tradeoffs when deciding whether or not to configure your dbt models as transient. By default, all Snowflake tables created by dbt are transient.

Configuring transient tables in dbt_project.yml

A whole folder (or package) can be configured to be transient (or not) by adding a line to the dbt_project.yml file. This config works just like all of the model configs defined in dbt_project.yml.

name: my_project

...

models:
  transient: false
  my_project:
    ...

Configuring transience for a specific model

A specific model can be configured to be transient by setting the transient model config to true.

{{ config(materialized='table', transient=true) }}

select * from ...

Merge behavior (incremental models)

New in dbt v0.14.0

The incremental_merge config for Snowflake was added in dbt v0.14.0. For upgrading instructions, consult the docs

The incremental_merge config controls how dbt builds incremental models. By default, dbt will use a merge statement on Snowflake to refresh incremental tables.

Snowflake's merge statement fails with a "nondeterministic merge" error if the unique_key specified in your model config is not actually unique. If you encounter this error, you can instruct dbt to use a two-step incremental approach by setting the incremental_merge config for your model to delete+insert.

This config can either be specified in specific models, or for all models in your dbt_project.yml file:

# Your dbt_project.yml file

models:
  incremental_strategy: "delete+insert"

or:

{{
  config(
    materialized='incremental',
    unique_key='id',
    incremental_strategy='delete+insert'
  )
}}

select ...

Snowflake specific configurations


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.