Back to problems

Design an idempotent SQL ETL for late data

SQL · Stripe · Hard

You maintain the daily_user_metrics fact table. You need a rerunnable, idempotent ETL that can be invoked for any UTC date D and must handle duplicate raw rows, late arrivals up to two days after the business date, and later order-status corrections. Provide whiteboard-level SQL for the core transformation and explain the upsert/merge strategy. All timestamps are in UTC. The source schemas are: users_dim(u_id BIGINT, created_at TIMESTAMP, country VARCHAR(2), is_test INT)…

Checking your access…