Skip to main content

GCP Pipeline Reference: Generic CDP Transformation — dbt models for FDP to CDP (JOIN pattern across all 3 FDP tables)

Project description

fdp-to-consumable-product

Deployment type: BigQuery (dbt) Layer: CDP — Consumable Data Product Pattern: JOIN across 3 FDP tables → 1 CDP table

Overview

This deployment builds the CDP (Consumable Data Product) layer by joining all three FDP tables from fdp_generic into a single denormalised view per customer:

fdp_generic.event_transaction_excess    ─┐
fdp_generic.portfolio_account_excess    ─┼──► cdp_generic.customer_risk_profile
fdp_generic.portfolio_account_facility  ─┘

The customer_risk_profile CDP table is the primary source for the mainframe-segment-transform pipeline, which reads each row and writes an outbound fixed-width segment file back to GCS for downstream mainframe consumption.

Data Flow

ODP (odp_generic) ──► FDP (fdp_generic) ──► CDP (cdp_generic) ──► GCS segment files
       ↑                    ↑                      ↑                      ↑
  Dataflow/Beam          dbt JOIN/MAP           dbt JOIN          Dataflow/Beam
  (ingestion)          (bigquery-to-         (this deployment)   (mainframe-segment-
                       mapped-product)                            transform)

CDP Table: cdp_generic.customer_risk_profile

One row per customer per extract date. Combines:

Source FDP Table Fields
event_transaction_excess customer identity, account exposure, current balance
portfolio_account_excess risk decision, score, decision outcome
portfolio_account_facility loan amount, interest rate, term, facility status

Derived field cdp_segment:

  • ACTIVE_APPROVED — decision approved + positive balance
  • DECLINED — decision declined
  • REFERRED — decision referred for manual review
  • PENDING — no decision yet

Structure

deployments/fdp-to-consumable-product/
├── pyproject.toml
├── Dockerfile                   # generic-cdp-transformation image
├── cloudbuild.yaml
├── dbt/
│   ├── dbt_project.yml
│   ├── packages.yml
│   └── models/
│       ├── staging/fdp/         # Thin wrappers over fdp_generic source tables
│       │   ├── _fdp_sources.yml
│       │   ├── stg_fdp_event_transaction_excess.sql
│       │   ├── stg_fdp_portfolio_account_excess.sql
│       │   └── stg_fdp_portfolio_account_facility.sql
│       └── cdp/                 # CDP output table
│           ├── _cdp_models.yml
│           └── customer_risk_profile.sql
└── tests/

Running Locally

# Setup venv
./scripts/setup_deployment_venv.sh fdp-to-consumable-product

# Activate and install dbt deps
source deployments/fdp-to-consumable-product/venv/bin/activate
cd deployments/fdp-to-consumable-product/dbt
dbt deps

# Run CDP models
export GCP_PROJECT_ID=joseph-antony-aruja
dbt run --target dev

# Run tests
dbt test

Docker Build

cd /path/to/gcp-pipeline-reference
gcloud builds submit \
  --config deployments/fdp-to-consumable-product/cloudbuild.yaml \
  --substitutions _LIBRARY_VERSION=1.0.7 \
  .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcp_pipeline_ref_cdp-1.0.13.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcp_pipeline_ref_cdp-1.0.13-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file gcp_pipeline_ref_cdp-1.0.13.tar.gz.

File metadata

  • Download URL: gcp_pipeline_ref_cdp-1.0.13.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for gcp_pipeline_ref_cdp-1.0.13.tar.gz
Algorithm Hash digest
SHA256 54c026e5427e3f67e01aaa51cd23069a5e927602a61acbabf74b7a3fbd6770c4
MD5 f27910a4d85d894801f42dc1fb8b4cac
BLAKE2b-256 8cc21df399131cbe21570a4aa825febde362505cdc0af81b261dc831c1407fea

See more details on using hashes here.

File details

Details for the file gcp_pipeline_ref_cdp-1.0.13-py3-none-any.whl.

File metadata

File hashes

Hashes for gcp_pipeline_ref_cdp-1.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 fbc7a084ff4997c2a50b91f479bbbe7f41817799c8c1faa14197e29c0b4fed73
MD5 e402a3938fe09404e5f41675157452fe
BLAKE2b-256 7da5d10fda738f10e3d2b16574ec2732f4d39c59c686cbe7a839730068e875ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page