hands-on lab

Understand and Work With dbt Seeds

Difficulty: Intermediate
Duration: Up to 1 hour
Students: 161
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

When you have to model data for analysis purposes, you could be in the need to start from one or more analysis datasets you have stored as CSV files. In this scenario, you'd like to use your CSV files as sources for your dbt models in your project.

Because of these scenarios, dbt offers seeds. A dbt seed is a CSV file that is usually uploaded under the seeds folder, and that can be leveraged as it was a dbt model. When a dbt seed is built, the CSV data is loaded into your database. You can leverage it by using the ref dbt macro.

In this lab, you will create a CSV file that will be your dbt seed, and you will create a full-refresh dbt model that is based on the seed.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Understand what seeds are and how to use them
  • Create dbt seeds and leverage them with models

Intended Audience

  • Data analysts that need to perform transformations over a CSV dataset
  • Developers that need to understand how to enable local CSV upload on dbt

Prerequisites

To get the most from this lab, you should have basic knowledge of dbt. To get ready, you can use the following labs:

Covered topics

Lab steps

Connecting to the dbt Web IDE
Creating a dbt Seed
Creating a dbt Model Based on the Seed
Build the dbt Seed and Execute the Model