How do you retire a column from a published mart when dashboards you don't own still read it?
answer
- the list in your head is incomplete
- query history knows who reads it
- the view is the contract, not the table
- which removal is one statement to undo?
- an unpopulated column still answers queries
basics
~20 sFind the consumers from warehouse query logs and BI lineage, publish a replacement and a sunset date, then remove the column from the consumer-facing view first while the base table keeps it. Only drop the base column once nothing has read the view column for a full reporting cycle.
solid answer
~50 sThe reason consumers query a **view** rather than the base table is exactly this moment: the view is the contract, and it can be changed independently of storage. The sequence is: (1) enumerate real consumers from warehouse query history and BI lineage, never from memory — the dashboards you know about are the ones that will not break; (2) publish the replacement column and let it run alongside for at least one full reporting cycle, including monthly and quarterly refreshes; (3) mark the column deprecated in the catalog with a named owner and a dated sunset; (4) at sunset, drop it from the **view** only, which is a one-statement rollback if you missed someone; (5) drop it from the base table weeks later, once nothing has failed. Resist leaving it forever as a zombie column — an unpopulated or stale column that still exists is more dangerous than one that is gone, because it silently returns wrong answers.
code
sql · 8 lines-- consumers bind to the view, so this is the reversible step
CREATE OR REPLACE VIEW rpt_customer AS
SELECT customer_sk,
customer_id,
tier_code -- replacement, published weeks earlier
-- customer_tier: removed at sunset, still present in dim_customer
FROM dim_customer
WHERE is_current = TRUE;go deeper
Know that a published column may be read by dashboards nobody told you about, and that the safe move is to find out who reads it and warn them before removing anything.
Explain the mechanics of the view facade: consumers bind to the view, so removing a column there is the reversible step, while the base table keeps the data until you are confident.
Show the full sequence with evidence — query history and BI lineage for consumer discovery, a replacement published first, a dated sunset covering the slowest reporting cycle, and why an unpopulated column is worse than a removed one.
Own the deprecation policy: mandating that consumers bind to views rather than base tables, requiring a named owner and sunset date on every deprecation, and holding a cap on how long anything may sit deprecated.
## Why the view layer exists If consumers select from base tables, every physical change is a consumer-visible change and the model calcifies: nobody dares rename anything. Serving BI tools and downstream teams through a thin view layer buys indirection. The view names, orders and types the columns you promise; the table underneath is free to be reshaped, rebuilt at a different grain, or re-keyed. Retiring a column is the case that pays for the whole arrangement, because it lets you make the change in a place where reverting is a single `CREATE OR REPLACE VIEW`. ## Step 1 — find out who actually reads it The list in your head is wrong. Sources of truth, in rough order of reliability: - **Warehouse query history** — the definitive record of what has been selected and by which service account or user, over whatever retention you have. Look back at least a quarter: month-end and quarter-end consumers only appear on those days. - **BI-tool lineage or content search** — which dashboards, extracts and semantic-layer fields reference the column. - **Downstream model code** — grep the transformation repository for the column name. - **Extracts and reverse-ETL** — the consumers most likely to be forgotten, because they are unattended jobs rather than people. Expect to find consumers you have never heard of. That discovery is the point of the exercise, not a failure of it. ## Step 2 — give them somewhere to go A deprecation without a replacement is a demand, not a migration. Publish the new column or the corrected definition first, let both coexist, and write down the exact rewrite each consumer needs — "replace `customer_tier` with `dim_customer.tier_code`, values `A/B/C` map to `GOLD/SILVER/BRONZE`". Migration effort you can hand over as a diff gets done; migration effort described as a principle does not. ## Step 3 — announce it where it will be seen A dated deprecation note belongs in the data catalog next to the column definition, in the model's documentation, and in a direct message to the owners you identified. A chat announcement alone scrolls away. Include: the sunset date, the replacement, the owner to contact, and the reason. Give at least one full reporting cycle — a monthly report that runs on the 3rd needs to have run at least once after the notice. ## Step 4 — remove from the view before removing from storage This is the ordering that makes the operation cheap to reverse: ```sql -- sunset day: the contract changes, storage does not CREATE OR REPLACE VIEW rpt_customer AS SELECT customer_sk, customer_id, tier_code -- customer_tier removed FROM dim_customer; ``` If a forgotten consumer breaks, restoring the column to the view is one statement and no data movement. Only after a quiet period — long enough to cover the slowest reporting cadence you care about — do you stop populating and then drop the underlying column. ## What not to do: the zombie column The worst outcome is a column that still exists but is no longer maintained. It returns stale values, or NULLs, or a frozen snapshot from the day the pipeline stopped writing it. Every query keeps working and quietly returns wrong answers, and because nothing errors nobody investigates. If you are not going to maintain a column, remove it from the contract. "Kept for compatibility but no longer populated" is not compatibility. A related anti-pattern is the permanent deprecation: a column marked deprecated for three years, still populated, still read, with no sunset date. Deprecation without a date is documentation of an intention, not a plan. ## The deliberate-break technique, and its cost Some teams null a deprecated column for a short, pre-announced window to flush out unknown consumers who did not respond to notices. It works — silence from the notice, complaints from the canary — but it deliberately serves wrong numbers for a period, so it belongs only on internal, non-decision-bearing columns, with the window announced in advance and kept short. On anything a business decision rests on, do not do it; use query logs instead. ## Checklist an interviewer wants to hear Find consumers from logs, publish a replacement, announce with a dated sunset and a named owner, remove from the view first, wait a full cycle, then drop from storage — and never leave an unmaintained column in the contract.
- Why remove the column from the view before dropping it from the base table?Because the view change is the reversible one. If an unidentified consumer breaks, restoring the column to the view is a single statement with no data movement, whereas restoring a dropped base column means a rebuild or a restore. The view removal is also what actually tests whether anyone still reads it.
- What is wrong with keeping a deprecated column in place but no longer populating it?It becomes a zombie: queries keep succeeding and quietly return NULLs or frozen values, so consumers get wrong answers with no error to investigate. A column that is part of the published contract must be maintained; if you will not maintain it, take it out of the contract.
- How long should a deprecation window be?At least one full cycle of the slowest consumer you found, and longer if quarter-end or year-end processes read the column. A monthly report that runs on the third needs to have run at least once after the notice. Pick the date from consumer cadence, not from convenience.
saying these in an interview costs you the question
- Relies on memory or a chat poll to find consumers
- Drops the base column first and views second
- Leaves the column in place but stops populating it
- Deprecates with no sunset date or named owner
- Announces only in a chat channel that scrolls away