1) Find when/where nulls appeared (root-cause timeline)- Reproduce: run the view and confirm NULL columns and which dashboards use it.- Time-window: identify migration time and compare results before/after using historical table snapshots or backups.- Drill-down queries:sql
-- check number of NULLs over time (if timestamp available)
SELECT DATE(event_time) dt, COUNT(*) nulls
FROM source_table
WHERE important_col IS NULL
GROUP BY dt
ORDER BY dt;
sql
-- compare view output before/after migration if audit table exists
SELECT COUNT(*) FROM view_name WHERE important_col IS NULL AND created_at < '2025-11-01';
SELECT COUNT(*) FROM view_name WHERE important_col IS NULL AND created_at >= '2025-11-01';
- Schema diff: inspect DDL changes (column renames, type changes, NULLABLE flag, join keys) and migration scripts. Check downstream ETL jobs that populate fields.2) Mitigate user impact (short-term)- Create a patch view that coalesces nulls to previous values or fallbacks and point dashboards to it:sql
CREATE OR REPLACE VIEW view_patch AS
SELECT a.*, COALESCE(a.important_col, b.important_col_old) important_col
FROM new_source a
LEFT JOIN historical_source b USING (id);
- Rollback option: if migration reversible quickly, restore previous schema in a maintenance window.- Communicate: notify stakeholders, mark dashboards with Known Issue banner, and freeze scheduled reports.- Add monitoring: alert on >X% NULLs.3) Prevent recurrence (process changes)- Pre-migration checks: automated schema-diff, nullability and join-key validation, and sample-data comparison (row counts, key uniqueness).- Add integration tests that run dashboards' critical queries on a staging copy and assert no unexpected NULLs or data loss.- Migration runbook: include rollback steps, maintenance window, stakeholder notification.- Post-migration validation: automated data-quality suite (unit tests, anomaly detection) and temporary feature flagging to switch dashboards.- Ownership: require sign-off from BI and data-engineering for schema changes that affect views/dashboards.Result: This approach finds the breakage window, restores safe output quickly, and closes process gaps so future migrations trigger early detection and safe rollout.