Skip to main content

Materialize Profile

Vendor-supported plugin

Certain core functionality may vary. If you would like to report a bug, request a feature, or contribute, you can check out the linked repository and open an issue.

Overview of dbt-materialize

Maintained by: Materialize, Inc. Source: Github Core version: v0.18.1 and newer dbt Cloud: Not Supported dbt Slack channel Link to channel

Installation and distribution

The dbt-materialize adapter is managed in the core Materialize repository. To get started, install dbt-materialize using pip (and optionally a virtual environment):

python3 -m venv dbt-venv         # create the virtual environment
source dbt-venv/bin/activate # activate the virtual environment
pip install dbt-materialize # install the adapter

To check that the adapter was successfully installed, run:

dbt --version

You should see materialize listed under “Plugins”. If this is not the case, double-check that the virtual environment is activated!

Connecting to Materialize

Once you have Materialize installed and running, adapt your profiles.yml to connect to your instance using the following reference profile configuration:

~/.dbt/profiles.yml
dbt-materialize:
target: dev
outputs:
dev:
type: materialize
threads: 1
host: [host]
port: [port]
user: [user]
pass: [password]
dbname: [database]
schema: [name of your dbt schema]

To test the connection to Materialize, run:

dbt debug

If the output reads "All checks passed!", you’re good to go! Check the dbt and Materialize guide to learn more and get started.

Supported Features

Materializations

Because Materialize is optimized for transformations on streaming data and the core of dbt is built around batch, the dbt-materialize adapter implements a few custom materialization types:

TypeSupported?Details
sourceYESCreates a source.
viewYESCreates a view.
materializedviewYESCreates a materialized view.
tableYESCreates a materialized view. (Actual table support pending #5266)
indexYES(Deprecated) Creates an index. Use the indexes config to create indexes on materializedview, view or source relations instead.
sinkYESCreates a sink.
ephemeralYESExecutes queries using CTEs.
incrementalNOUse the materializedview materialization instead. Materialized views will always return up-to-date results without manual or configured refreshes. For more information, check out Materialize documentation.

Seeds

Running dbt seed will create a static materialized view from a CSV file. You will not be able to add to or update this view after it has been created. If you want to rerun dbt seed, you must first drop existing views manually with drop view.

Tests

Running dbt test with the optional --store-failures flag or store_failures config will create a materialized view for each test you've chosen to store. This view is a continuously updating representation of failures.

Resources