milestone 1/12 Reconcile extraction & Bronze ingestion
Reconcile source counts with ingested records.
CRM + ERP Integration · Follow extraction reconciliation, authoritative integration, date quarantine, quality gates, stable keys, replay-safe loads, and atomic promotion. Finish with a customer-grain capstone and field-level lineage.
approach
Bronze preserves raw values. Compare a supplied extraction manifest to landed counts before cleaning; a matching count alone cannot prove correct column alignment. A discrepancy is evidence to investigate, not permission to delete data.
worked-example.sql
WITH landed AS( SELECT 'CRM' AS source_name,COUNT(*) AS landed_rows FROM crm_people UNION ALL SELECT 'ERP',COUNT(*) FROM erp_people ) SELECT m.source_name, m.expected_rows, l.landed_rows, l.landed_rows-m.expected_rows AS difference FROM load_manifest m JOIN landed l USING(source_name);
data for this milestone
crm_people5 columns · 6 rows
| source_rowinteger · key | customer_idtext | nametext | gendertext | updated_attext |
|---|---|---|---|---|
| 1 | C001 | Alice | F | 2025-01-01 |
| 2 | C001 | Alice Nguyen | F | 2025-01-05 |
| 3 | C002 | Ben | n/a | 2025-01-02 |
| 4 | C003 | Cara | F | 2025-01-03 |
| 5 | C004 | Dev | NULL | 2025-01-04 |
showing 5 of 6 rows
erp_people3 columns · 5 rows
| erp_idtext | gendertext | birth_datetext |
|---|---|---|
| NASC001 | Male | 1990-05-12 |
| NASC002 | Male | 1988-02-29 |
| NASC003 | Female | 2028-01-01 |
| NASC004 | Other | 1995-06-20 |
| NASC999 | Female | 1980-01-01 |
all 5 rows
load_manifest2 columns · 2 rows
| source_nametext · key | expected_rowsinteger |
|---|---|
| CRM | 6 |
| ERP | 5 |
all 2 rows