Transformation

Cleaning, casting, joining, aggregating and deduplicating — expressed as a dependency graph of tested, documented models rather than a pile of scheduled scripts.

Data Transformation
▶ lab

Clean, cast, join, aggregate, deduplicate, enrich, filter, normalize, denormalize — nine operations, each with a way of being wrong that does not raise an error.

Q · What are the operations that turn raw arrival into a queryable table, and which of them can be wrong while every job reports success?
SQL Transformations
▶ lab

The five-line aggregate everyone writes, and the thirty-line one that is still correct after duplicates, refunds, currency and late data exist.

Q · Why does the obviously correct `SUM(revenue) GROUP BY customer_id` stop being correct, and what does the correct version actually have to account for?
dbt Concepts
▶ lab

Transformations as version-controlled, tested, documented models whose dependencies are inferred rather than declared — and materialisation as a choice you make on purpose.

Q · What does a transformation framework actually give you that a folder of scheduled SQL scripts does not?
The Transformation DAG
▶ lab

raw_orders to stg_orders to int_orders_enriched to fct_orders to customer_metrics — five nodes, four edges, and everything you can ask of a graph you did not have to draw.

Q · What does turning a pile of transformations into an explicit dependency graph let you ask that you could not ask before?
DAGs in Data Pipelines
▶ lab

Node, edge, no cycles — the whole structure. Why every question a data platform asks about itself turns out to be a standard graph traversal, and why a cycle is almost always a modelling error.

Q · Why is the dependency graph of a data platform required to be acyclic, and what does a cycle actually tell you when you find one?
Topological Execution
▶ lab

If A feeds C and B feeds C, then A and B can run together and C must wait. What that ordering buys — parallelism, correctness of order, selective rebuild — and the one thing it emphatically does not buy.

Q · What exactly does executing a graph in topological order guarantee, and what does a completed topological run still fail to tell you?
Model Layering
▶ lab

Staging renames and types one source. Intermediate joins and reshapes. Marts face the business. The rule that makes it work is that consumers depend only on marts.

Q · Why split a transformation into staging, intermediate and mart layers when one query would produce the same table?
The Metrics Layer
▶ lab

Business logic copied into twenty dashboards produces twenty definitions of revenue, all defensible. A metric defined once, with an owner, is the only fix — and it does not fix everything.

Q · Two teams present revenue for the same quarter and the numbers differ. Both queries are correct. What is actually broken?