Skip to content

dbt — Data Transformations & Modeling

dbt (data build tool) manages SQL-first data transformations in the AetherLake Lakehouse using the Medallion Architecture (Bronze → Silver → Gold). Models run on top of Trino over TLS (dbt-trino), writing Parquet files to MinIO S3 and registering tables in the Apache Polaris Iceberg REST catalog.

  • Profile: pipelines/dbt/profiles.yml (lakehouse_trino)
  • Adapter: dbt-trino connecting via Trino HTTPS port 8443
  • Catalog: Apache Iceberg catalog managed by Polaris REST
  • Control Panel: Interactive /dbt workspace (Lineage DAG, Model Inspector, Run Triggers, and Test Reports)

🏛️ Medallion Architecture Flow


🎛️ Control Panel Workspace

The /dbt page in the Control Panel provides a full-featured web interface:

dbt Lakehouse Workspace

  1. Interactive Data Lineage (DAG):
    • Visual dependency graph from Bronze sources to Silver staging models and Gold analytics marts.
    • Interactive zoom/pan controls with layer filtering and upstream/downstream dependency tracing.
  2. Model Inspector:
    • View raw Jinja/SQL source code and compiled Trino SQL.
    • Column schemas, data types, and applied data quality tests (unique, not_null, accepted_values).
  3. Execution & Test Runner:
    • One-click triggers for dbt run and dbt test against Trino.
    • Real-time run logs and execution history with durations and model statuses.

🚀 Running dbt via CLI

To run dbt transformations locally from your terminal:

bash
cd pipelines/dbt

# Test Trino TLS connection
dbt debug --profiles-dir .

# Run all models (Bronze -> Silver -> Gold)
dbt run --profiles-dir .

# Run data quality tests
dbt test --profiles-dir .

# Run only gold layer models
dbt run --select gold --profiles-dir .

Connection Configuration (profiles.yml)

yaml
lakehouse_trino:
  target: dev
  outputs:
    dev:
      type: trino
      method: ldap
      host: trino.aetherlake.local
      port: 8443
      user: admin
      password: "{{ env_var('TRINO_PASSWORD', 'admin123') }}"
      database: iceberg
      schema: lakehouse_silver
      threads: 4
      http_scheme: https
      cert: ../../control-panel/.ca/aetherlake-ca.crt

📁 Model Structure

LayerPathPurposeMaterialization
Sourcesmodels/sources.ymlRaw bronze table definitionsSource
Silvermodels/silver/stg_user_events.sqlCleaned and deduplicated eventstable (Iceberg Parquet)
Silvermodels/silver/stg_users.sqlUser lifetime metrics & tieringtable (Iceberg Parquet)
Goldmodels/gold/fct_daily_user_metrics.sqlDaily aggregated metrics for Supersettable (Iceberg Parquet)
Goldmodels/gold/fct_event_summary.sqlEnriched event dimension marttable (Iceberg Parquet)
Testsmodels/schema.ymlData quality validationsunique, not_null, accepted_values

Released under the Business Source License 1.1.