Skip to content

Repository files navigation

burstbank dbt project

A dbt project built on the Starburst Galaxy sample.burstbank dataset — a fictional retail bank with customers, accounts, and payment history across three product lines: credit cards, mortgages, and auto loans.

Prerequisites

  • Python 3.9+
  • A Starburst Galaxy cluster with access to the sample catalog and write access to a lakehouse catalog
  • A lakehouse catalog configured in your Galaxy cluster (Iceberg recommended)

Setup

1. Install dependencies

pip install -r requirements.txt
dbt deps

2. Configure your profile

Copy sample.profiles.yml to ~/.dbt/profiles.yml and set the required environment variables:

export GALAXY_HOST=<your-cluster-host>.trino.galaxy.starburst.io
export GALAXY_USER=you@example.com
export GALAXY_PASSWORD=your-password

3. Verify the connection

dbt debug

Running the project

dbt run       # build all models
dbt test      # run schema tests
dbt docs generate && dbt docs serve   # browse the data catalog

To build a single layer:

dbt run --select staging
dbt run --select marts

Project structure

models/
├── sources.yml          # points to sample.burstbank (read-only source)
├── staging/             # one view per source table, written to lakehouse.burstbank_staging
│   ├── stg_accounts.sql
│   ├── stg_auto_loan_payments.sql
│   ├── stg_credit_card_payments.sql
│   ├── stg_customer_profiles.sql
│   ├── stg_customers.sql
│   ├── stg_employees.sql
│   ├── stg_mortgage_payments.sql
│   ├── stg_product_profiles.sql
│   └── stg_state_census.sql
└── marts/               # analytics-ready tables, written to lakehouse.burstbank_marts
    ├── dim_customers.sql
    ├── fct_payments.sql
    └── rpt_customer_risk.sql

Data model

Sources (sample.burstbank)

Table Description
customer Customer demographics — name, address, DOB, FICO score
account Per-customer account holding credit card, mortgage, and auto loan identifiers and balances
customer_profile Customer segmentation — career, risk appetite, segment
product_profile Product details — rates, loan officers, durations, vehicle/residence type
credit_card_payment Credit card payment history
mortgage_payment Mortgage payment history
auto_loan_payment Auto loan payment history
employee Bank employees, used to resolve loan officer names
state_census US state population estimates for geographic enrichment

Staging (lakehouse.burstbank_staging)

Views that clean the source layer: varchar dates are cast to date, boolean flags (Y/N) are cast to booleans, and the manger_id typo in the employee table is corrected to manager_id.

Marts (lakehouse.burstbank_marts)

Model Description
dim_customers Customer dimension joining demographics, segmentation, and state census data
fct_payments All payment events across credit cards, mortgages, and auto loans in a single table, with a product_type column and delinquency flag
rpt_customer_risk Customer-level risk summary: total payments, delinquent payment count, delinquency rate, and outstanding balance by product

Catalog layout

Catalog Schema
Source data (read-only) sample burstbank
Staging views lakehouse burstbank_staging
Mart tables lakehouse burstbank_marts

About

A dbt project built on the Starburst Galaxy sample.burstbank dataset — a fictional retail bank with customers, accounts, and payment history across three product lines: credit cards, mortgages, and auto loans.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors