EX-3: Medallion Standardization View (Bronze to Silver)
Track: Architecture & Modeling • Difficulty: Beginner • Mastery Points: 100 PTS
Business Problem Scenario
Raw customer demographic extracts in bronze.crm_customers arrive from upstream CRM channels with inconsistent formatting: mixed-case email addresses with irregular whitespace, erratic UK postal codes containing stray internal spaces, and customer telephone numbers containing hyphens, parentheses, and leading noise. These formatting inconsistencies corrupt downstream entity resolution and prevent reliable joins.
Engineering Objective
Create the conformed standardizing view silver.crm_std over bronze.crm_customers. • Expected Columns: crm_id, full_name, email_std, phone_std, dob, postcode_std, country_code • Explicit Transformation Rules & Examples: - email_std: lower(trim(email)). Example: ' John.Doe@Example.com ' -> 'john.doe@example.com' - postcode_std: upper(regexp_replace(postcode, ' ', '')). Example: 'sw1a 1aa' -> 'SW1A1AA' - phone_std: concat('+', regexp_replace(phone, '[^0-9]', '')). Example: '(020) 7946-0123' -> '+02079460123' - Null handling: Preserve null values without throwing errors. Key Concepts: - Medallion Conformance: Standardizing dirty bronze data types into uniform silver views prior to enterprise entity resolution.
Target Table: bronze.crm_customers (crm_id STRING, full_name STRING, email STRING, phone STRING, dob DATE, postcode STRING, country_code STRING)
Verification & Architecture Insights
Standardizing keys at the silver transition layer prevents false negatives during identity deduplication and matching without altering source bronze logs.