Understand Basel Committee BCBS 239 data traceability principles in plain English—building auditable Source-to-Target (S2T) documentation, column lineage, and ingestion metadata columns.
Suppose a diner gets sick from bad spinach—or a bank regulator asks: "Show me exactly how the `$4.2 Billion Risk Exposure` number on Slide 12 was calculated!"
SUM(amount * fx_rate)) -> `silver.loans` -> `bronze.core_banking_json`, including the exact timestamp, git commit, and batch ID that produced it!| Term / Keyword | Plain-English Meaning | Concrete Example |
|---|---|---|
| BCBS 239 (Principle 3 & 4) | Global banking standard requiring complete, accurate, repeatable risk data aggregation. | Must reconcile totals from General Ledger -> Risk Reports automatically. |
| Data Lineage (Table vs. Column) | Map showing where data came from (upstream) and where it goes (downstream). | Column lineage: bronze.amt_cents / 100.0 -> gold.amount_usd. |
| Source-to-Target (S2T) Mapping | Engineering blueprint table documenting exact source field, type conversion, and business rule for every target column. | Used by devs to code & by auditors to verify transformation logic. |
| Audit Metadata Columns | Standard tracking columns added to Bronze/Silver/Gold rows (_ingested_at, _source_file, _batch_id). | Lets engineers isolate bad batches in seconds. |
| Reproducibility / Time Travel | Ability to re-run or query an exact historical month-end snapshot identically months later. | SELECT * FROM gold.capital_return VERSION AS OF 42. |
Before writing pipeline code for regulated finance, healthcare, or finance-grade KPIs, teams publish an S2T Matrix:
| Target Table.Column | Target Type | Source Table.Column | Transformation Rule | Quality Check |
|---|---|---|---|---|
gold.deposits.account_id | STRING | bronze.raw_acct.acct_num | TRIM(UPPER(acct_num)) | NOT NULL, Unique PK |
gold.deposits.balance_usd | DECIMAL(18,2) | bronze.raw_acct.bal, silver.fx.rate | CAST(bal * rate AS DECIMAL(18,2)) | balance_usd >= -5000.00 |
gold.deposits.reporting_date | DATE | Pipeline runtime param | COALESCE(as_of_date, CURRENT_DATE) | <= CURRENT_DATE |
gold.deposits._batch_run_id | STRING | Pipeline metadata | Job run UUID injected at write | NOT NULL |
Make every Lakehouse pipeline self-documenting and debuggable with zero extra effort using standard audit metadata columns:
INSERT INTO silver.ledger_transactions
SELECT
TRIM(txn_id) AS transaction_id,
CAST(amount_cents / 100.0 AS DECIMAL(18, 2)) AS amount_usd,
currency_code,
-- Standard Audit & Traceability Metadata:
_metadata.file_path AS _source_file_uri,
CURRENT_TIMESTAMP() AS _silver_processed_at,
's2t-v1.4.2' AS _transform_version,
'job-20260501-0400-utc' AS _pipeline_run_id
FROM bronze.raw_core_transactions
WHERE txn_id IS NOT NULL;Look what happens during an incident 3 months later: An analyst notices unusual transactions on Tuesday. You run:
SELECT DISTINCT _source_file_uri, _pipeline_run_id, _transform_version
FROM silver.ledger_transactions
WHERE transaction_date = '2026-05-01';In 2 seconds, you trace every dollar back to the exact raw S3/ADLS file and exact code version!
WHERE status != 'VOID' exists) alongside automated graphs—because SQL code shows *what* ran, while S2T explains *why* regulators require it._pipeline_run_id metadata + audit summary logs so historical audits stay verifiable even after VACUUM.BCBS 239), never delete cancelled rows—keep reversing ledger entries (amount = -100.00, is_reversal = true) so net balances sum transparently to source controls!_source_file_uri, _pipeline_run_id, and _processed_at.Test your understanding of the concepts covered in this lesson.
Under BCBS 239 banking rules, financial institutions must be able to trace every number on an official regulatory return back to the exact source table and column where it originated (Source-to-Target lineage). We need to build an auditable lineage mapping row for the regulatory deposit total.