Ray Voelker
Cincinnati & Hamilton County Public Library
ray.voelker@chpl.org
SELECT — called a model — and dbt turns it into a table, in the right order, tested and documented.-- model: checkouts (one SELECT = one table)
select checkoutId as checkout_id,
title, branch, format,
try_strptime(checkoutDateUtc,
'%m/%d/%Y %H:%M:%S') as checked_out
from read_json('overdrive_*/page_*.json')ref(), and dbt works out what to build first — and draws the map.from {{ ref('checkouts') }} c
join {{ ref('dim_title') }} d using (title_id)raw → checkouts → dim_title ↘ daily_by_audienceraw → refined → enriched — has a name: medallion. dbt moves data between the layers. (More in its own issue.)columns:
- name: checkout_id
tests: [not_null, unique]dbt docs generate — draws the dependency graph and the documentation.