Turn Raw Orders Into A Staging Model
Build a thin staging model from a raw orders source with names, casts, and tests.
Raw orders has cryptic names, string timestamps, and status codes used by three downstream analyses. One source-shaped staging model creates a stable interface: rename, cast, preserve grain, and test keys. The shortcut is to patch the final mart because it is the visible failure. That hides whether the defect is raw data, staging cleanup, join grain, or metric definition. Declare source Add jaffle_shop.orders under sources: with description and loaded_at field. dbt now has a named raw boundary and a place for freshness. Create stg model Select one row per raw order, rename id to order_id, cast created_at, and standardize status…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in