liveBook · Manning

Dbt

As explained in Architecting an Apache Iceberg Lakehouse

dbt is an open-source tool for transforming data in analytical data warehouses and lakehouses using SQL-based models, testing, and documentation.

dbt provides a lightweight, model-driven way to keep Iceberg maintenance close to transformation logic. A model can process new data, then a run-operation macro can invoke SQL procedures such as snapshot expiration. section 11.1.1 section 11.1.5

A dbt-based Iceberg workflow can:

-- models/transform_customer_data.sql
SELECT *
FROM raw.customers
WHERE updated_at >CURRENT_DATE - INTERVAL '30 days'

-- macros/expire_snapshots.sql
{% macro expire_snapshots(table_name) %}
    CALL {{ table_name }}.system.expire_snapshots(
        older_than =>CURRENT_TIMESTAMP - INTERVAL '7 days'
    );
{% endmacro %}

Inspect a dbt model and macro that filter recent customer data and expire old Iceberg snapshots. section 11.1.5

How Architecting an Apache Iceberg Lakehouse covers it

How deep it goes
Explains model, macro, and run-operation integration, but stops short of full scheduling and DAG management.
Examples
Demonstrates a transformation model, an expiration macro, and dbt run-operation execution.
What it assumes
Assumes a dbt project and a SQL engine that supports Iceberg procedures.
What you can do after
Operate Iceberg post-transformation cleanup by defining dbt macros and invoking them with run-operation.
How it connects
Connects dbt with Apache Iceberg, SQL procedures, data transformations, snapshot expiration, and Airflow.

Also explained in

Compare how 3 books explain dbt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting an Apache Iceberg Lakehouse. The section links point to the parts of the book it draws on.