TICKIT-09: Gold Marts, Time Travel and CDF
Track: TICKIT Marketplace • Difficulty: Advanced • Mastery Points: 200 PTS
Business Problem Scenario
Downstream fraud detection services and financial reconciliation engines need real-time row-level change feeds showing exact row updates, price adjustments, and cancellations in gold.fact_sales. Delta Lake Change Data Feed (CDF) exposes row-level change vectors (_change_type, _commit_version, _commit_timestamp). You must enable CDF on the table and write a query using table_changes() to inspect update post-images.
Engineering Objective
Enable CDF via ALTER TABLE gold.fact_sales SET TBLPROPERTIES and query table_changes(). • TBLPROPERTIES: Set 'delta.enableChangeDataFeed' = 'true'. • Expected Columns: sales_sk, salesid, pricepaid, commission, _change_type, _commit_version. • Query Filter: Query table_changes('gold.fact_sales', 1) where _change_type = 'update_postimage'. Key Concepts: - Change Data Feed (CDF): Built-in Delta Lake streaming capability exposing insert, update, and delete row events.
Target Table: gold.fact_sales (sales_sk BIGINT, salesid INT, pricepaid DECIMAL(10,2), commission DECIMAL(10,2))
Verification & Architecture Insights
CDF enables downstream event-driven microservices to consume only modified transaction records, eliminating costly batch recalculations.