Working with a first project

Introduction to dbt

Mike Metzger

Data Engineer

Workflow for dbt

  1. Create project (dbt init)
  2. Define configuration (profiles.yml)
  3. Create / use models / templates
  4. Instantiate models (dbt run)
  5. Verify / Test / Troubleshoot
  6. Repeat as needed
Introduction to dbt

dbt run

  • Run whenever there model changes
  • Or when the data process needs to be materialized
  • Output provides many details on the success or failure of the various steps
  • Materialized = Transformations into tables / views
repl:~$ dbt run
04:52:11  Running with dbt=1.8.4
...
04:52:13  1 of 1 START sql view model main.sales_data ....... [RUN]
04:52:13  1 of 1 OK created sql view model main.sales_data . [OK in 0.12s]  
...
04:52:13  Completed successfully
Introduction to dbt

Table vs View

Tables:

  • Objects within a database / warehouse that hold data
  • Take up space within the database
  • Content only updated when changed

$$

  • Can be created by dbt ✅

Views:

  • Queryable like a table; hold no information
  • Are usually defined as a select query against another table or tables
  • Content generated with each query

$$

  • Can be created by dbt ✅
Introduction to dbt

Let's practice!

Introduction to dbt

Preparing Video For Download...