Welcome to the dbt Labs Snowflake Demo Project!
This dbt project is intended to showcase key Snowflake + dbt functionalities in terms of workflow, modeling, and operationalizing.
In order to successfully run this project, you will need the following:
- A Snowflake account
- dbt Cloud account
- Snowflake Sample Data The TPC-H dataset that is standard with every account
- Default Snowflake warehouse named compute_wh
This project was built with the intent to be used with the dbt Cloud IDE and the UserFlow guided tour but if you're unable to do this, here are the steps.
- Read the entire README
- Check out the dbt_project.yml file. There you will find where we have defined our materializations, query tags, warehouse sizes, and hooks.
- Go to models/staging/tpch/stg_tpch_customers.sql. Read about how we write our models
- Compile the code for stg_tpch_customers
- Run
dbt deps
to install all the packages in the packages.yml - Run
dbt run
to run all of your dbt models. - Look at the logs (under details) to see what SQL was ran.
- Run the show_incremental_model query in the analysis folder by clicking on
Preview Data
- Run
dbt run -m incremental_dim_orders
to run the model incrementally - Run the show_incremental_model query in the analysis folder again with Preview Data.
- Take a look at the incremental logic in incremental_dim_orders
- Run
dbt test
to run the tests on your dbt models. Check out the models/staging/tcph/stg_tpch.yml file to see how tests are applied. - Generate docs by running
dbt docs generate
and click on theView Docs
on the left hand side. - Check out the docs site and click on the blue button on the botton to view the DAG. Right click on a node to refocus. Then right click again to view the docs.
- Create a production environment by clicking on the hamburger menu > environments.
- Create a production job by clicking on the hamburger menu > jobs > create the job.
- Run the production job.
If you have time, take a look at other aspects of the project. We have included other fun features for you to see, including:
- How to change output based on environments
- How to dynamically pivot vs hardcoding your pivot
- Learn more about dbt in the docs
- Check out Discourse for commonly asked questions and answers
- Join the chat on Slack for live discussions and support
- Find dbt events near you
- Check out the blog for the latest news on dbt's development and best practices
This is a open source project. If you want to contribute to this project/find any issues, interact with us on the repository