Snowflake integration with dbt lets you transform data in Snowflake using modular, version-controlled SQL models managed by dbt.
Create a Snowflake user with ROLE, WAREHOUSE, and database access. Install dbt-snowflake (`pip install dbt-snowflake`) and configure your profiles.yml
.
profiles.yml
for Snowflake?Place the profile in ~/.dbt/profiles.yml
. Use account, user, password or keypair auth, role, warehouse, database, and schema parameters.See exact syntax below.
Use dbt run
to build models, dbt test
for assertions, and dbt seed
to load CSV seed data—all executed inside Snowflake.
Create a model file customers_orders.sql
selecting from Customers
and Orders
.dbt materializes it as a view or table in Snowflake, ready for analytics.
Set query_tag
for cost tracking, use incremental models for large tables, and apply dbt run-operation
macros for warehouse grants.
1. Using a low-size warehouse causes long runtimes—switch to an appropriately sized, auto-suspend warehouse.
2. Forgetting to grant schema privileges to the dbt user—grant USAGE
, SELECT
, and CREATE
.
Yes; set authenticator: externalbrowser
in profiles.yml
.
Use dbt build --select state:modified
with dbt --state
artifacts.
.
Not natively, but you can invoke run-operation
macros to call CREATE ... CLONE
before builds.
Set auto-suspend on warehouses, use dbt --threads
judiciously, and monitor QUERY_HISTORY
with query tags.