Using the source() Function for Raw Tables in dbt
📖 Scenario: You are working on a data project where you need to use raw data tables stored in your data warehouse. These raw tables are managed outside of dbt, but you want to reference them safely in your dbt models.Using dbt's source() function helps you refer to these raw tables clearly and track their usage.
🎯 Goal: Build a simple dbt model that uses the source() function to select data from a raw table called raw_customers in the raw schema.You will create a source configuration, then write a model that selects all columns from this source table.
📋 What You'll Learn
Create a source configuration for the
raw_customers table in the raw schemaWrite a dbt model SQL file that uses the
source() function to select all data from raw_customersPrint the resulting SQL query that dbt will run
💡 Why This Matters
🌍 Real World
In real data projects, raw data tables are often managed outside dbt. Using the <code>source()</code> function helps you reference these tables clearly and track their usage in your dbt models.
💼 Career
Data analysts and engineers use dbt to build reliable data pipelines. Knowing how to use <code>source()</code> is essential for managing dependencies on raw data sources.
Progress0 / 4 steps