Skip to content
Tech Interview Prep
Technical interview guide

Data Catalog & Lineage

Making data discoverable and traceable: what a dataset means, where it came from, and what depends on it.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed
Relevant for
Data Architect

Scope: W3C DCAT 3 and PROV-O, OpenLineage 1.53 object model/facets, Google Cloud Knowledge Catalog lineage, dbt manifest artifacts, Apache Atlas lineage API, and UK metadata guidance current 2026-08-31.

Interview Q&A

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

25 questions

Q&A-2

Define stable identities for catalog resources.

Answer

Core answer, first 90 seconds. "Stable identity" means the key that lineage, ownership, tags and access policies hang off does not change when the human-readable name does. So I split identity in two: an immutable surrogate key minted at first registration, and a path that is just an attribute of that key. Everything downstream (lineage edges, PII tags, owners, grants) keys on the surrogate. The path is resolved through an alias table.

Assumptions I'd state up front: a catalog federating several platforms (Snowflake, BigQuery, S3/Glue, Kafka), multi-tenant, with consumers that persist references. BI dashboards, dbt models, feature stores. If it's a single-tenant index over one platform with rare renames, the alias layer is overhead and I'd skip it.

Why the platform URN alone isn't enough. Most catalogs embed the path inside the identifier, so the identifier is not actually stable across a rename:

SystemIdentity formWhat moves on rename
DataHuburn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.public.orders,PROD)the name segment, so the URN changes
Unity Catalogcatalog.schema.tableany of the three levels
AWS Gluearn:aws:glue:us-east-1:123456789012:table/analytics/ordersdatabase and table segments
OpenMetadataservice.database.schema.table FQNthe path

That's the mechanism to call out: the URN is path-derived, so you add a surrogate layer above it rather than trusting the URN as the key.

Rename trace. Table registered as surrogate ds-7f3a, path analytics.public.orders, URN urn:li:dataset:(...,analytics.public.orders,PROD). Renamed to analytics.public.fct_orders:

  1. Catalog emits a rename event.
  2. Alias row written: analytics.public.orders -> ds-7f3a, valid_to = now.
  3. New URN minted for the new path; both URNs map to ds-7f3a.
  4. Lineage, tags and ownership keyed on ds-7f3a: no split.
  5. A dashboard still holding the old URN resolves through the alias table.

Failure modes, with detection. No alias table: the lineage graph splits into two nodes, PII tags and ownership don't carry, and downstream impact is double-counted. Detect by counting datasets with identical schema hash and overlapping lineage. Tenant collision: two accounts both hold analytics.public.orders; if the key omits account and region you conflate them and can grant access to the wrong tenant's data. Enforce a uniqueness constraint on (platform, account, region, path). Case: Snowflake stores unquoted identifiers uppercase, so inconsistent case-folding yields ORDERS and orders as two entities; detect by duplicate count after case-fold. Restore: restoring a backup re-registers tables with fresh surrogate IDs, leaving two live entities for one physical table; detect by the same storage location appearing under two surrogates.

Trade-offs. Path-as-key is readable and needs no resolution service, but a rename creates a new entity: acceptable only for low-churn, single-tenant catalogs. Surrogate-only is stable but every consumer needs a resolution call and it breaks when a source system only knows the path. Hybrid plus alias table is what I'd pick; the cost is an extra write path and an alias merge policy, when a path is reused by a genuinely different table you must expire the alias, not silently resolve it to the old surrogate.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-3

Create minimum metadata requirements for a critical dataset.

Answer

Assumptions first. "Critical" here means tier 1: a dataset whose wrongness or absence breaks a decision, a regulatory filing, or a customer-facing surface. Minimum means the smallest set that lets a consumer decide whether to trust it and lets an on-call engineer diagnose it at 03:00 without pinging the producer. For a tier-3 table, most of this is overkill.

The minimum is eight groups, not twenty fields. Everything else is tier 2.

#GroupWhy it is minimumWhat breaks without it
1Stable ID + schema versionLineage edges, joins and contracts key off itA rename silently orphans downstream models
2Accountable owner + contactSomeone must be pageableAlerts route to a dead alias
3Business definition + row grain"One row per order" vs "per order line"Two teams compute different revenue
4Authoritative source + upstream lineageTells you where to fix itDebugging starts at the wrong table
5Schema with typesEnables contract enforcementType drift breaks consumers at read time
6event_time column, observation_time, freshness SLOStaleness is the top silent failureConsumers trust stale data
7Classification + permitted/prohibited useLegal exposurePII lands in an open zone
8Retention + lifecycle stateDeletion and deprecationData outlives its legal basis

Tier 2 (examples, spatial/temporal coverage, distributions, quality score, downstream lineage) is worth having and never blocks promotion.

Carry it in a contract, not a wiki. dbt 1.5+ enforces schema; meta carries the governance fields:

YAML
models:
  - name: fct_orders
    config:
      contract: {enforced: true}
    meta:
      owner: "priya.n@example.com"        # accountable human, not a list
      steward: "finance-analytics"
      tier: 1
      classification: "confidential"
      permitted_use: "internal reporting; no ML training"
      retention: "P7Y"
      event_time_column: "order_created_at"
      freshness_slo: "max_lag=30m p99"
      source_of_truth: "snowflake://prod.raw.orders"
    columns:
      - name: order_id
        data_type: string
        constraints: [{type: not_null}, {type: unique}]

Freshness has to be arithmetic, not an adjective. Hourly batch at :00, p99 runtime 22 min. A consumer reading at :59 sees data whose newest event_time is ~:00, and the next run has not landed: worst-case lag is 60 min of period + 22 min runtime ≈ 82 min. So max_lag=30m is unachievable at hourly cadence: you need a 15-minute schedule or CDC. Define the SLO as measured p99 of observation_time − max(event_time), never as "refreshes hourly".

Trade-offs. Catalog-only (DataHub, OpenMetadata, DCAT-AP for public data) is cheap and drifts within a quarter; contract-enforced (dbt contracts, an Avro/Protobuf registry) fails the build but slows schema changes. For tier 1, enforce schema and freshness, leave business definition advisory. Scanners infer schema and lineage for free (OpenLineage emits schema, dataSource, ownership and lifecycleStateChange facets) but they cannot infer intent, permitted use or accountability, so those must be pushed by the producer. Block tier-1 promotion on the eight groups; score the rest.

Failure modes and detection. Owner is a team alias nobody reads: measure time-to-ack on metadata-driven pages; p50 above 4h means the field is decorative. Freshness SLO declared but unmeasured: alert when observation_time − max(event_time) exceeds SLO on two consecutive checks. One false page a quarter beats a wrong board number. Schema change without a version bump: OpenLineage schema-facet diff or dbt contract CI failure. Classification null: policy scan, and block tier-1 promotion while it is null.

What changes the decision: regulatory exposure and consumer count. A tier-1 dataset feeding a filing needs retention and permitted use enforced, not advisory; an internal tier-3 table needs an owner and a definition and nothing else.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-1

Design a data catalog for a multi-team data platform.

Answer

Core answer

Assume ~50k tables across Snowflake and BigQuery, an S3/Iceberg lake, ~200 Kafka topics, and Looker/dbt on top, owned by ~40 teams. The catalog is a metadata service, not a database of data. Three planes: technical metadata harvested automatically, human metadata owned by stewards, and derived usage and lineage. Identity is a URN per asset, stable across renames.

Then pick build vs buy. Engineering-led platform: run DataHub or OpenMetadata. Both open source, both ingest via YAML recipes and emit metadata change events over Kafka. Compliance-heavy with non-technical stewards: buy Collibra or Atlan. Then harvest, then lineage, then governance workflow, then SLOs.

Mechanism

Identity: urn:li:dataset:(urn:li:dataPlatform:snowflake,analytics.orders.fct_orders,PROD). Platform, qualified name, environment. Column URNs hang off it.

Harvest schema from INFORMATION_SCHEMA.COLUMNS, usage from query history. Cadence by tier:

tierassetsschema cadenceusage cadencestaleness SLO
critical~2k15 min1 hp95 < 30 min
standard~20k6 h24 hp95 < 24 h
long tail~30k24 h7 dbest effort

Observation time matters because metadata is a claim about a moment: a schema harvested at 09:00 is wrong after a 09:30 migration. Store last_observed_at per aspect, not per asset, so a stale owner field doesn't invalidate a fresh schema.

Lineage has two sources. Static: parse SQL from dbt manifests and view definitions with sqlglot. Dynamic: OpenLineage events emitted by Airflow and Spark at runtime. Merge them: static catches column lineage, runtime catches dynamic SQL and Python transforms static can't see.

JSON
{
  "eventType": "COMPLETE",
  "job": {"namespace": "airflow", "name": "dbt.fct_orders"},
  "inputs": [{"namespace": "snowflake://acct", "name": "analytics.orders.stg_orders"}],
  "outputs": [{"namespace": "snowflake://acct", "name": "analytics.orders.fct_orders"}],
  "eventTime": "2025-01-14T09:31:02Z"
}

Harvest load arithmetic: 2k critical tables at 15-min cadence is 96 cycles/day × 2k = 192k metadata reads/day. Batched 500 per query, that's 384 queries/day at ~50 ms each: about 20 s of warehouse time. Negligible. Column profiling is the expensive part: profiling 2k critical tables at 1% sample costs real credits, so schedule it nightly, not every 15 minutes.

Trade-offs

Build (DataHub/OpenMetadata) when lineage depth and extensibility matter and you have platform engineers. Buy (Collibra/Atlan) when you need out-of-the-box policy workflows, glossary UX, and compliance evidence for non-engineers. Deciding criteria: number of non-technical stewards, regulatory scope, and whether you'll write custom ingestion.

Lighter approach: under ~50 tables, one team, no regulatory driver. A schema registry (Confluent or Glue) plus dbt docs plus a wiki beats a catalog. The catalog's real cost is stewardship labor, not software.

Failure modes

  • Stale metadata: alert when p95 now - last_observed_at exceeds the tier SLO; a certified asset breaching freshness should auto-demote.
  • Ownerless assets: track the share of critical assets with a named owner, orphan report weekly, target >95%.
  • Harvest load on production: read from replicas or INFORMATION_SCHEMA, throttle, run off-peak, and watch warehouse queue time during harvest windows.
  • Lineage gaps: reconcile parsed lineage against observed query logs; a table read in logs with no upstream edge is a gap.
  • Certification drift: certified assets whose quality checks fail or freshness breaches.

Metrics

Successful reuse: distinct consumer teams per asset, not view count. Change safety: share of breaking schema changes preceded by a lineage-based impact review. Incident resolution: MTTR for data incidents where lineage was used versus not.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-4

Design catalog search and ranking.

Answer

Clarify first. I'd ask three things before designing: corpus size and growth, who searches (analysts, engineers, or both), and whether the catalog already has usage telemetry. I'll assume a mid-size org: ~200k datasets and dashboards, ~5k weekly searchers, OpenSearch 2.11 as the store, and click logs from the last 90 days. If there's no telemetry, I'd ship a hand-weighted ranker first and learn from it.

The core answer: retrieve wide, then rank narrow. Two stages, because a single scorer can't do both recall and precision well.

Retrieval runs BM25 over analyzed fields plus a kNN vector search over a 384-dim embedding of title+description, fused with reciprocal rank fusion (RRF, k=60). BM25 defaults k1=1.2, b=0.75: b=0.75 is what stops a 2,000-word description from outranking a tight one. Fuzzy matching is fuzziness: AUTO on title only; on description it produces noise. Synonyms come from the glossary index, expanded at query time, not baked into the analyzer, so you can change them without reindexing.

Ranking is a linear blend over normalized signals:

signalweightsource
text relevance (BM25+kNN, RRF-normalized)0.55query
certification tier0.20governance metadata
freshness decay0.10last updated
quality score (null rate, test coverage)0.10profiling
usage (30-day query count, log-scaled)0.05query logs

Freshness is exp(-age_days/180): a 30-day-old table scores 0.85, a year-old one 0.13. Usage is deliberately the smallest weight: it's the signal most likely to be self-reinforcing.

Authorization is a filter, not a post-filter. Put the ACL terms filter inside the query so the candidate set is already restricted:

JSON
POST /catalog/_search
{
  "size": 20,
  "query": {
    "bool": {
      "filter": [{ "terms": { "acl_groups": ["eng", "analytics"] } }],
      "must": [{ "hybrid": { "queries": [
        { "match": { "title^3": { "query": "customer churn", "fuzziness": "AUTO" } } },
        { "knn": { "embedding": { "vector": [/* 384 floats */], "k": 50 } } }
      ] } }]
    }
  }
}

Post-filtering after top-k is the classic leak: you return 20 candidates, drop 17 on ACL, and the user sees 3, and facet counts can still reveal the hidden 17. Filtering in-query keeps counts honest.

Explainability. Each result carries a matched_terms array plus owner, last-updated, certification tier, and a limitations note. Users trust a ranker they can argue with.

Failure modes and how I'd catch them.

  • Popularity loop: top-10 median age drifts past 400 days while clicks stay flat. Detect by logging rank-vs-click correlation weekly; if the top-10 is dominated by the same 50 datasets for 3 weeks, decay usage weight.
  • ACL leak: run a synthetic user with zero group memberships against the full query set; assert zero results and zero facet counts. This is a CI test, not a manual check.
  • Keyword stuffing: a dataset whose description repeats "revenue finance sales" ranks #1 for unrelated queries. Detect by monitoring term repetition ratio per doc; cap title boost at ^3 and rely on b=0.75.
  • Zero-result queries: track the rate. Above ~8% of queries, the glossary expansion is missing terms: that's a synonym backlog, not a ranking bug.

Trade-off I'd state out loud. A learned ranker (LambdaMART over click logs) beats the linear blend once you have ~50k labeled impressions, but it inherits whatever bias is in the logs: including the popularity loop. I'd keep the linear blend as the fallback and A/B the learned model behind an interleaving test, not a straight swap.

Evaluation. Representative task set per domain (finance, growth, infra), scored on success@5 and time-to-first-correct-result, plus zero-result and abandonment rates sliced by domain. A ranker that improves overall success@5 but doubles abandonment in finance is a regression, not a win.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-6

Model OpenLineage jobs, runs, and datasets correctly.

Answer

What I'd say first. Assume Airflow orchestrates and Spark computes, both emitting OpenLineage, and the catalog team is asking why a table looks fresh after a failed job. The fix is to lay out the three entities so a consumer can rebuild lineage without guessing.

OpenLineage has exactly three nouns. A job is the recurring process; its identity is namespace + name, e.g. namespace: "spark", name: "orders_agg". A run is one execution of that job, identified by a runId UUID you mint per attempt. A dataset is a table, file or topic, identified by namespace + name where the namespace is the physical or logical container: postgres://warehouse:5432 + public.orders. Everything else is a facet hung off one of those three.

You emit a RunEvent per lifecycle transition: START, optionally RUNNING, then exactly one terminal COMPLETE, FAIL or ABORT. Each event carries eventTime, producer, schemaURL (which embeds the spec version, e.g. .../spec/2-0-2/OpenLineage.json#/$defs/RunEvent), the run, the job, and inputs/outputs.

JSON
{
  "eventTime": "2024-06-01T02:14:07.512Z",
  "eventType": "COMPLETE",
  "producer": "https://github.com/apache/airflow",
  "schemaURL": "https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/RunEvent",
  "run": {
    "runId": "3f2b1c9e-7a44-4d10-9c2b-1e5f0a8d6b31",
    "facets": {
      "nominalTime": {"nominalStartTime": "2024-06-01T02:00:00Z"},
      "parent": {"run": {"runId": "a1c9..."},
                 "job": {"namespace": "airflow", "name": "daily_orders"}}
    }
  },
  "job": {"namespace": "spark", "name": "orders_agg"},
  "inputs":  [{"namespace": "postgres://warehouse:5432", "name": "public.orders"}],
  "outputs": [{"namespace": "postgres://warehouse:5432", "name": "public.orders_daily",
               "facets": {"version": {"version": "2024-06-01"}}}]
}

Why facets live where they do. The scoping rule falls out of the key each facet is stored under. Run facets are keyed by runId, so they describe this attempt and freeze when the run ends: nominalTime, errorMessage, parent. Dataset facets are keyed by dataset namespace+name and accumulate across runs: schema, version, lifecycleStateChange. Job facets describe the process definition and are stable across runs: sql, sourceCodeLocation, ownership. The test: if the value changes every execution it is a run facet; if it describes the entity it is a job or dataset facet. That is why the concrete partition value written this run is a run facet, while the partition column is a dataset facet.

DecisionOption AOption BCost of choosing wrong
runId sourcereuse orchestrator run idmint fresh UUIDa collision collapses two runs into one node and overwrites facets
namespacephysical URIlogical namea mismatch splits one table into two disconnected nodes
event granularitySTART+RUNNING+COMPLETECOMPLETE onlyno duration or in-flight view; three times the event volume
partition valuerun facetdataset facetdataset facet overwrites history on every run

Failure modes and how you catch them. Treating START as success: a freshness sensor marks the table fresh on START. Detect it by alerting on runs that have START and no terminal event after nominalEndTime plus SLA; the consequence is stale data served as fresh. Dropping the parent facet: the Spark job appears as a root, so the graph shows two disconnected jobs. Detect orphan runs with no parent edge. Namespace drift: one producer emits postgres://warehouse:5432 and another warehouse.orders_daily, producing two nodes for one table; detect duplicate dataset names under different namespaces.

Decision criteria. Always emit a terminal event. Put per-execution values on the run, entity descriptions on the job or dataset. Use the physical namespace unless infrastructure moves often enough to justify a logical one. Reuse the orchestrator runId only when it is globally unique; otherwise mint a UUID.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-5

Design lineage capture across orchestrators, SQL engines, and dbt.

Answer

What I'd say first (60-120 seconds)

Before choosing where to capture lineage, I'd ask what consumes it. Impact analysis and cost attribution need table-level edges that are always present; debugging one wrong metric needs column-level edges, which are never complete. Assume Airflow 2.x orchestrates dbt Core on Snowflake, one Spark job writes two marts directly, and a BI tool queries the warehouse with no model behind it. Assume 15-minute freshness is fine and we own every collector.

The design: one event model, OpenLineage, emitted by all three producers, run ID as the join key, declared lineage (dbt manifest) stored separately from observed lineage (warehouse audit log and engine events) but keyed by the same canonical dataset identity.

JSON
{
  "eventType": "COMPLETE",
  "eventTime": "2025-06-11T04:12:07.884Z",
  "producer": "https://github.com/OpenLineage/OpenLineage/tree/main/integration/dbt",
  "run": {"runId": "9f1c2a7e-6b04-4a1e-9d3f-1f2b6c0e5a11"},
  "job": {"namespace": "dbt://airflow-prod", "name": "model.jaffle_shop.orders"},
  "inputs": [
    {"namespace": "snowflake://acct12345.us-east-1", "name": "ANALYTICS.RAW.CUSTOMERS"},
    {"namespace": "snowflake://acct12345.us-east-1", "name": "ANALYTICS.MARTS.ORDERS"}
  ],
  "outputs": [
    {"namespace": "snowflake://acct12345.us-east-1", "name": "ANALYTICS.MARTS.ORDERS",
     "facets": {"schema": {"fields": [
       {"name": "SEGMENT", "inputFields": [
         {"namespace": "snowflake://acct12345.us-east-1", "name": "ANALYTICS.RAW.CUSTOMERS", "field": "SEGMENT"}]}]}}}
  ]
}

Identity is the hard part, not transport. The canonical key is (namespace, normalized name); the namespace names the instance, never the table. Normalization is per engine because case folding differs: Snowflake folds unquoted identifiers to upper case, Postgres to lower, BigQuery dataset IDs are case-sensitive. Lowercasing everything merges Snowflake's "Foo" and FOO into one node, and you find out from an impact report months later. Keep the native ID verbatim in a facet plus an alias table for renames, so the merge is auditable. The dbt side joins on relation_name from manifest.json rather than on model name, and keeps unique_id as the stable node key.

There's a self-edge in that event, and it is the reconciliation problem in miniature: an incremental model's MERGE reads its own target, so observed inputs contain the output. Diff three sets per run on the canonical key. Declared-only: ephemeral models, tests, exposures, sources never read. Observed-only: that self-read, ad-hoc BI queries, compiled SQL pointing at a physical table the manifest never names. Both, different columns: a SELECT * the engine expanded, or a UDF body a parser cannot see. Act on the buckets differently. Declared-only nodes unobserved for weeks are stale metadata to delete; observed-only is the coverage number you report; column mismatches are what pages someone.

routegivesmissescostwins when
dbt manifest.json + catalog.jsondeclared DAG with owners, tests, exposuresad-hoc and BI readers; Spark and Python writesalready produced by dbtdbt is the only writer
warehouse audit log (Snowflake ACCESS_HISTORY, BigQuery INFORMATION_SCHEMA.JOBS)observed table and column edges for every queryanything outside the warehouse; ACCESS_HISTORY lags the live system and keeps a year; JOBS exposes referenced_tables per jobextraction query cost; edges from queries you will never modelyou must cover BI and human queries
runtime events (OpenLineage Spark integration, Trino event listener)plan-level edges including dynamic SQLanything outside that runtime; coupling to the runtime versionper-session agent and upgrade workSpark or Python writes bypass dbt

Decision rule: manifest alone if dbt is the only writer, engine events only where Spark or Python writes directly, audit-log extraction only when you must cover readers you do not control.

What I would instrument:

  • Collector gaps. Events stop for a DAG and nothing errors. Detect by reconciling Airflow task-instance counts per dag_run_id against OpenLineage events per run ID; alert when the ratio drops below 1 for two consecutive runs. The cost is an impact report returning "no downstream" while someone backfills over live tables.
  • Retry duplication. Producers are at-least-once and retries re-emit START. Dedupe on (runId, eventType, try number); a job-plus-time-window key swallows the retry that actually wrote the data and leaves a stale output set.
  • Identity drift. A rename or case change splits one node into two. Alert on any new canonical key that appears without an alias entry, and on keys that stop appearing.
  • Query text. SQL carries literal PII, so redaction has to happen in the producer's facets, not in a dashboard filter.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-7

Reconcile declared and runtime lineage.

Answer

First, clarify what we're reconciling. Declared lineage is what the code says it will read and write: dbt's manifest.json, a data contract, or a Spark job's static plan. Runtime lineage is what actually executed: OpenLineage events emitted by Airflow, Spark, or dbt runs. The assumption is batch pipelines, orchestrated by Airflow 2.x, with lineage landing in Marquez or a similar store.

The core answer: build a reconciliation table that joins declared edges to observed edges on (job_name, job_version, source_dataset, target_dataset, direction). Each edge record carries: src_urn, dst_urn, edge_type (declared or observed), producer, job_name, job_version, code_hash, run_id, observed_at, evidence_source. Normalize dataset names to a URN like urn:li:dataset:(urn:li:dataPlatform:postgres,db.schema.table,PROD). Join on src_urn, dst_urn, job_name, job_version. Classify each row as matched, declared_only, observed_only, or version_mismatch.

Worked example, hypothetical numbers. A daily job orders_daily at version v42. Its dbt manifest declares 1,200 edges. OpenLineage events from the last 7 successful runs show 1,150 distinct edges. The join gives 1,110 matched, 40 declared_only, 40 observed_only, 10 version_mismatch (observed edges still coming from v41 during a rolling deploy). Coverage = 1,110 / 1,200 = 92.5%. Observed-only rate = 40 / 1,150 = 3.5%.

Now triage. Declared_only edges: check if they sit behind a feature flag or a conditional write. If the flag is off in every run, that edge is expected. If the flag is on and the edge is missing, that's a failure. Observed_only edges: look for dynamic SQL, e.g. INSERT INTO {{ params.table }}. The declaration can't know the table name, so the fix is to add a contract or a parameterized declaration. Or it's hidden code: a script not in the manifest. Version_mismatch: backfill or rolling deploy; compare code_hash.

Trade-offs. Strict reconciliation fails the pipeline on any diff. Tolerant reconciliation only alerts on observed_only edges that touch production tables or PII. Deciding criteria: if a missing dependency breaks a revenue dashboard, strict is right. If you get 40 expected declared_only edges per day from an unexecuted branch, strict causes alert fatigue and blocks deploys. A middle path: block on observed_only edges with severity=high (PII, revenue), warn on declared_only edges older than 7 days.

Failure modes. Feature flags: observed_only when flag on, declared_only when off. Dynamic SQL: observed_only with templated names. Failed runs: declared edge with no observed because the job failed. Distinguish by checking run status (failed vs skipped). Backfills: observed edges with run_date in the past, may not match current declared version; compare code_hash.

What would change the decision: if all observed_only edges come from one dynamic SQL job, fix the declaration rather than alerting. If declared_only edges are all from a deprecated branch, remove them from the manifest.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-8

Implement column-level lineage responsibly.

Answer

Responsibly means you don't claim more than you can prove. I'd build a hybrid extraction pipeline: static SQL parsing for the bulk, query plans for dynamic SQL, and manual curation for the critical few. Then measure precision and recall per dataset, and expose a confidence score.

Assume we're in a warehouse like Snowflake or BigQuery, with SQL transformations. The goal is to answer "if I change this column, what breaks?" and "where does this PII flow?".

Start with static parsing. Tools like SQLGlot or Apache Calcite parse SQL into an AST, resolve CTEs, subqueries, aliases, and track column references through SELECT, WHERE, JOIN, GROUP BY. For a query:

SQL
SELECT o.order_id, c.email, SUM(o.amount) AS total
FROM orders o
JOIN customers c ON o.customer_id = c.id
WHERE o.status = 'shipped'
GROUP BY o.order_id, c.email;

The parser produces these edges:

output columnsource columndependency type
order_idorders.order_iddirect
emailcustomers.emaildirect
totalorders.amountaggregated
(row)orders.customer_idjoined
(row)customers.idjoined
(row)orders.statusfiltered

This takes milliseconds per query. In a hypothetical 500-table warehouse with 10,000 queries, a full parse takes about 2 minutes on one core. Precision is high for standard SQL: in a hypothetical sample of 100 edges verified against code, precision was 98%. Recall is lower: dynamic SQL, UDFs, and templated Jinja break the parser.

That's where query plans come in. For a query that fails to parse, run EXPLAIN and extract column-level dependencies from the plan. This is accurate because it reflects the actual execution, but it costs more: EXPLAIN on a complex query can take seconds, and not all engines expose column-level lineage in the plan. In our hypothetical, query-plan extraction for the same 10,000 queries takes 30 minutes and requires a dedicated warehouse. Use it only for the 5-10% of queries that fail parsing.

Runtime logs are a third source. Snowflake's ACCESS_HISTORY or BigQuery's audit logs give actual column access for executed queries. This is ground truth for what ran, but only covers executed queries, and retention is limited (e.g., 1 year). Use it to validate parser output: if parser says column A feeds column B but runtime logs never show A being read when B is written, flag it.

Manual curation is the last resort. For PII columns, you can't afford a miss. A data steward reviews the lineage for those 50 columns and signs off. This is expensive, maybe 1 hour per column, but necessary for compliance.

Failure modes: dynamic SQL (e.g., EXECUTE IMMEDIATE 'SELECT ' || col || ' FROM ' || table) causes the parser to miss edges. Detect by monitoring parse failure rate; if it exceeds 5%, investigate. Cost: missing lineage means impact analysis misses downstream PII, leading to GDPR violations. UDFs: parser can't see inside; mark as partial. Detect by comparing parser output to runtime logs for a sample; if discrepancy >10%, flag. Operational breakage: if lineage drives automated masking, missing edges leak data.

Trade-offs: parser is fast and cheap but incomplete. Query plan is accurate but slow and engine-dependent. Runtime logs are accurate for executed queries but incomplete for all possible queries. Manual curation is accurate but doesn't scale. The deciding criteria: if the query is static and standard, parser wins. If it's dynamic or uses UDFs, use query plan. If it's PII, manual curation.

Finally, measure precision and recall. Sample 100 edges, verify against code. If precision < 95%, don't expose lineage for automated decisions. Recall is harder; use query plans as ground truth for a sample. Apply access controls to lineage metadata: it reveals sensitive data. Version field identity by dataset version so schema changes don't break edges.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-9

Capture lineage for dynamic SQL and runtime-selected tables.

Answer

Assumptions: the engine exposes a query-history or audit surface, and you want observed lineage, what actually ran, not declared lineage. If you need pre-deploy impact analysis, this approach cannot give it.

Core answer: don't parse the SQL text. Dynamic SQL resolves its table names at execution time, so the only place the answer exists is the execution boundary: the point where the engine has turned the statement into a plan. Capture there: resolved object identifiers, query/plan identity, the job or run that issued it, and the code/config version. Then join that to your declared dependencies and label each edge observed vs declared.

Why: EXECUTE IMMEDIATE 'SELECT * FROM ' || tbl contains no table name. A regex or static parser sees a concatenation. The engine has already resolved tbl to sales.orders_2024_11 before it reads a row. The cheapest correct source is the engine's own audit table, not your parser.

Worked example: Snowflake. ACCESS_HISTORY records the objects a query actually read, keyed by query_id; QUERY_HISTORY has the text. Join them:

SQL
SELECT qh.query_id,
       qh.query_text,
       f.value:objectName::string AS accessed_object,
       f.value:objectDomain::string AS domain
FROM snowflake.account_usage.query_history qh
JOIN snowflake.account_usage.access_history ah
  ON ah.query_id = qh.query_id,
LATERAL FLATTEN(input => ah.base_objects_accessed) f
WHERE qh.start_time >= DATEADD(day, -1, CURRENT_TIMESTAMP())
  AND qh.query_text ILIKE '%EXECUTE IMMEDIATE%';

Trace: a stored proc runs EXECUTE IMMEDIATE 'SELECT * FROM sales.orders_' || :month. QUERY_HISTORY stores the literal text with :month bound: the table name is not in it. ACCESS_HISTORY stores SALES.ORDERS_2024_11 in base_objects_accessed, because resolution happened. The join yields one row per (query, accessed object); that row is your edge.

Caveats: ACCESS_HISTORY requires Enterprise Edition, lags up to 3 hours, retains 365 days. BigQuery's equivalent is INFORMATION_SCHEMA.JOBS_BY_PROJECT.referenced_tables, resolved per job, 180-day retention. Postgres has no resolved-object view for dynamic SQL; use auto_explain with log_nested_statements = on to capture statements issued from plpgsql EXECUTE.

Trade-offs.

approachcorrect on dynamic SQLlatencywhen to use
engine audit tableyes: resolution already happenedminutes–hoursobserved lineage, post-hoc
static parse (sqlglot)no: name is a runtime valueinstantdeclared deps, pre-deploy impact
plan capture (auto_explain)yesper-statement overheadOLTP with no audit table

Don't rely on runtime capture alone when you must answer "what will this job touch before it runs": it can only tell you what already ran.

Failure modes.

  • Opaque calls: an external function or a proc issuing its own SQL shows as a single edge. Detect by comparing declared vs observed edge counts per job; alert when a job has declared reads but zero observed reads.
  • Retries: each retry gets a new query_id, so you double-count edges. Dedupe on (job_id, normalized statement hash).
  • Literal leakage: QUERY_HISTORY keeps the literal text, so a dynamic statement with an inlined PII value lands in your lineage store. Redact before persisting; never store bind values.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-18

Model lineage for a streaming pipeline.

Answer

Clarify and assume. I'd ask what the lineage is for (incident triage, impact analysis, or compliance) because that decides granularity. I'll assume Kafka 3.x as the broker, Flink 1.18 or Spark Structured Streaming 3.5 as the processor, and an OpenLineage-compatible collector, since that's the common stack.

Core answer. Don't model lineage as a static DAG of jobs and tables. A streaming pipeline's lineage is a graph of versioned entities joined by time-bounded edges, and the edge is the interesting part. Four entity types: the logical stream (topic or table), the physical partition or file, the job version (code plus config hash), and the run. One execution of that version between a start and an end. Edges carry the time semantics: which offsets or snapshot IDs were consumed, and which event-time window they produced.

The identity keys matter more than the schema:

entityidentity keytime semantics
topiccluster + topic nameretention window (Kafka default log.retention.hours=168)
partitiontopic + partition idoffset range
job versionjob name + git SHA + config hashdeployed-at
runjob version + run UUIDstart/end, checkpoint or batch id
datasetnamespace + name + schema versionsnapshot or commit id

Trade-off. You can emit lineage from inside the job (OpenLineage RunEvent with START/COMPLETE/FAIL, carrying schema and watermark facets) or reconstruct it from the broker and coordinator (Kafka __consumer_offsets, Flink checkpoint metadata, Iceberg snapshot log). Push gives you semantics the broker can't see (column-level lineage, watermark state) but it's lossy: a job killed with SIGKILL never emits COMPLETE, so you get a dangling run. Pull is authoritative for offsets but blind to anything inside the operator. The deciding criterion is whether you need to answer "which input rows produced this output row" (push, per-batch runs) or "which job touched this topic last Tuesday" (pull, per-run). Most teams run both and reconcile.

Run granularity is the second trade-off. One run per restart is cheap but hides replay. One run per micro-batch is precise but explodes: a 1-second trigger is 86,400 runs per job per day. I'd default to one run per checkpoint for Flink (30s–1min interval) and one per micro-batch for Spark only when the sink is idempotent.

Failure modes.

Duplicate runs. Spark's StreamingQueryProgress carries id (queryId, stable across restarts) and runId (new on every restart). Key runs on queryId and you merge distinct executions; key on runId and a job restarting every 5 minutes produces 288 runs a day. Detect by counting distinct runIds per queryId per hour: a flat line at 12 means crash-looping.

Offset divergence. Flink's Kafka source restores offsets from the checkpoint, not from the consumer group, when you restore from a savepoint. Restart without one and it falls back to setStartFromGroupOffsets, which is the default, and the job silently jumps. Detect by diffing the offset in the checkpoint metadata against __consumer_offsets; a non-zero gap is a replay or a skip.

Savepoint restore. Operator state is keyed by uid. Change a uid and the restore fails with "Cannot map savepoint state": loud, which is fine. The quiet version is adding an operator without a uid, which gets an auto-generated one that changes on every rebuild.

Late data. Event-time windows emit after the watermark passes, so an output row's processing time can be minutes after its input's. If you timestamp lineage edges at processing time, you attribute output to the wrong window. Detect by comparing the window end in the output against the event-time range of the inputs.

Trace. Flink job, Kafka source, 30s checkpoint interval, exactly-once sink. Checkpoint 41 completes at t=0 with offsets p0=1000, p1=2050, p2=300. At t=12 the TaskManager dies. Restart at t=13 seeks back to those exact offsets. Records p0 1050–1099 were processed after checkpoint 41 and are replayed; p0 1000–1049 are not re-emitted because their sink commit was part of checkpoint 41. Lineage now shows two runs, R1 and R2, both reading p0 from offset 1000. If you keyed runs on job name, that looks like a duplicate read with no explanation, which is exactly the false-duplicate problem you're trying to avoid.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-19

Represent a backfill in lineage.

Answer

Core answer

Assume the backfill recomputes the same logical dataset the scheduled job produces (same inputs, same transform, same output table) for an interval that already ran. Under that assumption, model it as a new run of the same job, not a new job. Lineage graphs are keyed on job identity, (namespace, name). A new job node forks the graph, so the backfill's outputs have no edge to the original run's downstream consumers, and impact analysis silently misses every dashboard that read the old data. A new run keeps the edges and adds a run-level marker that says "this is a restatement."

In OpenLineage the run carries nominalTime (the interval being recomputed, not wall-clock), parent (the backfill campaign run id, so every task run of one backfill groups together), and jobType: BATCH. The output dataset carries lifecycleStateChange (OVERWRITE for a restatement, APPEND for filling a previously empty partition) and version, whose datasetVersion is the new snapshot id. The original run's event is never edited or deleted.

JSON
{
  "eventType": "COMPLETE",
  "run": {
    "runId": "9c1e...",
    "facets": {
      "nominalTime": {"nominalStartTime": "2024-03-01T00:00:00Z",
                      "nominalEndTime":   "2024-03-02T00:00:00Z"},
      "parent": {"run": {"runId": "backfill__2024-03-01"},
                 "job": {"namespace": "airflow", "name": "daily_orders"}}
    }
  },
  "job": {"namespace": "airflow", "name": "daily_orders",
          "facets": {"jobType": {"jobType": "BATCH"}}},
  "outputs": [{
    "namespace": "s3://lake", "name": "orders",
    "facets": {
      "version": {"datasetVersion": "4821"},
      "lifecycleStateChange": {"lifecycleStateChange": "OVERWRITE"}
    }
  }]
}

Airflow gives you the run marker for free: DagRun.run_type is backfill for airflow dags backfill runs and scheduled otherwise, and data_interval_start / data_interval_end are the interval. Filter on those, not on run_id string prefixes.

How downstream tells restated from original

The version facet is the whole mechanism. On Iceberg the backfill commits a new snapshot whose parent_id is the previous snapshot:

snapshot 4820  parent=4799  operation=append     added-data-files=12  added-records=1,204,331
snapshot 4821  parent=4820  operation=overwrite  added-data-files=12  deleted-data-files=12  added-records=1,198,004

A consumer pinned to snapshot-id=4820 keeps reading the original numbers; one on main reads 4821. Delta exposes the same thing through DESCRIBE HISTORY (version, operation, operationMetrics.numOutputRows) and VERSION AS OF. "Restated" is not a flag someone sets: it is a new immutable version with a parent pointer, and the reader chooses which to pin.

Trade-off: same job, new run vs. separate backfill job

same job, new runseparate backfill job
graphedges preservedforks; downstream of the original is not downstream of the backfill
consumersmust filter run_type != backfill or double-countno consumer change
costone job definitiontwo definitions that drift

Pick same-job when the backfill produces the same logical dataset. Pick a separate job only when the computation is genuinely different, a re-aggregation under a new metric definition, because then it is a different node and should be reviewed as one. Don't emit a lineage event for a read-only validation query, and don't cut a new dataset version for a run that wrote zero files; an OVERWRITE with no added-data-files is noise that trains people to ignore the version facet.

Failure modes and how you see them

  • Overlapping backfill and scheduled run on the same partition. Two writers, last-writer-wins, no error raised. Detect: two runs with the same nominalTime interval and non-empty added-data-files for the same dataset; alert on count(distinct run_id) > 1 per (dataset, interval). Symptom is a dashboard that flips between two values within minutes.
  • Late input after the backfill closed. The interval is marked complete but the source partition lands six hours later. Detect: source partition max(ingest_ts) greater than the backfill run's eventTime. The input facet shows the partition read at 03:00 while the file mtime is 09:00.
  • Mixed code versions. The backfill runs today's deployed code, not the code that produced the original. Record the git SHA on the run facet; if it differs from the original run's, the "corrected" number is a different metric, not a fix. Detect by diffing the SHA before publishing the restatement.
  • Non-idempotent append. A retry appends instead of overwriting. Detect: outputStatistics.rowCount roughly 2× the scheduled run's rowCount for the same interval.

Rollback is the previous snapshot id: keep it, and state in the restatement notice which snapshot downstream should pin if they need the old numbers.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-10

Build a reliable lineage-event ingestion service.

Answer

Assumptions. Producers are Airflow and Spark jobs emitting OpenLineage RunEvents over HTTP. Delivery is at-least-once. Peak is 5k events/s at ~1.2 KB per body. Events can arrive up to 15 minutes late and out of order. Consumers are a lineage graph API and a UI.

The answer. Terminate events at POST /api/v1/lineage, validate the body against the JSON Schema named in the event's schemaURL, append the raw event to Kafka, and only then project it into the graph. Raw events are immutable; every projection is a pure function of the raw log, so a wrong projection is fixed by replaying, not by patching rows.

Two keys do the work. The storage key is a SHA-256 over the canonicalized event body. The spec has no event id, so a producer retry that re-stamps eventTime produces a new key and a duplicate row, which is why the projection must also be idempotent, on (runId, eventType, eventTime).

Python
import hashlib, json

def event_key(ev: dict) -> str:
    body = json.dumps(ev, sort_keys=True, separators=(",", ":"))
    return hashlib.sha256(body.encode()).hexdigest()

INSERT_RAW = """
INSERT INTO raw_events (event_key, run_id, job_ns, job_name, event_type, event_time, body)
VALUES (%s, %s, %s, %s, %s, %s, %s)
ON CONFLICT (event_key) DO NOTHING
RETURNING event_key
"""

UPSERT_STATE = """
INSERT INTO run_state (run_id, state, event_time)
VALUES (%s, %s, %s)
ON CONFLICT (run_id) DO UPDATE
   SET state = EXCLUDED.state, event_time = EXCLUDED.event_time
 WHERE run_state.state NOT IN ('COMPLETE','FAIL','ABORT')
   AND EXCLUDED.event_time > run_state.event_time
"""

Run state is argmax(eventTime) with terminal states absorbing: the first COMPLETE/FAIL/ABORT wins and later events cannot reopen the run. Trace, with COMPLETE arriving before its own START because the START retry was delayed:

  1. COMPLETE R1 @10:00:04 → no row → insert (R1, COMPLETE, 10:00:04).
  2. START R1 @10:00:00 → conflict → run_state.state is terminal → WHERE false → no update. Raw row still written.
  3. Duplicate COMPLETE, identical body → same SHA-256 → ON CONFLICT DO NOTHING returns nothing → projection skipped.

Final state: COMPLETE, both raw rows retained, one projection write.

Ordering is a latency optimisation, not a correctness requirement, because the projection is event-time ordered and idempotent:

Kafka keyGuaranteeCostWrong when
runIdTotal order per runOne partition per run; a 100k-event Spark run pins oneYou need cross-run ordering
job.namespace + job.nameOrder per jobA single hot job skews one partitionJob fan-out is uneven
none (round-robin)NoneMax throughput, no skewProjection is not event-time ordered

Default to round-robin. Partition by runId only if you measure projection lag on a hot run.

Sizing: 5k/s × 1.2 KB = 6 MB/s. A 24-partition topic at replication factor 3 gives 72 replicas, ~0.25 MB/s each: disk is not the constraint. Postgres handles this with 500-row batches (10 tx/s); 6 MB/s is 518 GB/day, so tier raw events to object storage after 7 days and keep run_state forever.

Failure modes and their signals:

  • Re-stamped retries. Compare count(distinct event_key) to count(distinct (run_id, event_type)) per run; alert above 1.05.
  • Producer clock skew. max(event_time) - now() outside ±5 min, or a negative delta.
  • Unknown schemaURL. Reject with 422, route to a quarantine topic; alert when quarantine exceeds 0.1% of intake.
  • Missing terminal state. Runs with START and no terminal after 2× p99 run duration; reconcile against Airflow's dag_run table.
  • Consumer lag. Alert at >100k messages or >60s behind.

Skip Kafka entirely if you have one producer and one consumer: write straight to Postgres. Skip the dedup layer if events already arrive exactly-once from a transactional source; the SHA-256 and the unique index are pure overhead there.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-11

Detect missing lineage events.

Answer

What I'd say first

You can't find missing lineage events by reading the lineage stream: absence doesn't appear in it. The core move is to build an independent expectation set from the scheduler and the warehouse, then join it to what actually emitted, keyed on job + run_id, and alert on the gap.

Assumptions: batch jobs on Airflow, OpenLineage emitters on Spark and dbt, events landing in Marquez or a warehouse table. If your stack differs the join key changes but the shape doesn't.

Mechanism

Expectations come from the scheduler's own state, not from lineage. Airflow's dag_run and task_instance tables tell you what should have run and when. For unscheduled work (ad-hoc writes, notebooks) use the warehouse audit log: Snowflake QUERY_HISTORY or BigQuery INFORMATION_SCHEMA.JOBS show writes that should have had a producing run.

Then join expectations to events on job_namespace + job_name + run_id and classify the gap:

  • no START → emitter dead or job never launched
  • START but no COMPLETE → job hung or crashed
  • COMPLETE but no output dataset → job ran, didn't report its write

Set the deadline per job, not globally: scheduled time + 2× that job's p99 runtime from history. A global 30-minute window either pages on your slowest job or misses your fastest.

Trade-offs

Push vs pull. OpenLineage's HTTP transport pushes to Marquez with low latency, but a dead emitter is silent, and a dead emitter is exactly the failure you're hunting. So the push stream is the data, and the pull-side expectation join is the ground truth; you need both.

Native emitters vs audit-log parsing. The Spark OpenLineage listener and openlineage-dbt give dataset- and column-level lineage with a real run_id, but only for instrumented engines. Audit-log parsing covers everything that touches the warehouse, including untracked tools, but gives no column lineage and no run_id: you're matching on query text and time.

Failure modes

Heartbeat green, edges missing. The emitter process is up but the Spark listener failed to attach, so no events flow. A heartbeat proves the agent, not the edge. Detect it by comparing per-job event counts to the expected count for that hour.

Late events. A 15-minute window flags runs that emitted at minute 16. Use event-time watermarks, not wall clock.

Backfills. 200 backfilled runs emit at once and blow the window. Key on logical date, not emit time.

The check

SQL
WITH expected AS (
  SELECT dag_id AS job, run_id, logical_date,
         logical_date + INTERVAL '2 hours' AS deadline
  FROM dag_run
  WHERE logical_date > now() - INTERVAL '1 day'
)
SELECT e.job, e.run_id, e.logical_date
FROM expected e
LEFT JOIN lineage_events l
  ON l.job_name = e.job AND l.run_id = e.run_id
GROUP BY 1,2,3
HAVING max(CASE WHEN l.event_type='COMPLETE' THEN 1 END) IS NULL
   AND now() > e.deadline;

The LEFT JOIN keeps expected runs that emitted nothing; has_complete is NULL for them; the deadline filter drops runs still inside their window. Rows returned are your missing-terminal alerts.

Track known blind spots, engines with no emitter, with an owner and a remediation date, so the gap is a decision, not an accident.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-17

Unify lineage across cloud accounts and regions.

Answer

The core move is a two-level identity: a federated native ID that encodes provider, account, region, service, and resource, plus a governed crosswalk to a logical ID that can span accounts and regions. Assume you're using OpenLineage 1.x or a similar event spec, with AWS and GCP, multiple accounts, and a central lineage store like Marquez or DataHub.

For AWS, the native ID is the ARN: arn:aws:dynamodb:us-east-1:123456789012:table/orders. For GCP, it's the resource name: //bigquery.googleapis.com/projects/my-project/datasets/my_dataset/tables/my_table. These are globally unique. But they don't tell you that the same logical dataset exists in another account. So you maintain a crosswalk table:

Native IDLogical IDValid fromValid to
arn:aws:dynamodb:us-east-1:123456789012:table/ordersprod.orders2024-01-01null
arn:aws:dynamodb:eu-west-1:987654321098:table/ordersprod.orders2024-01-01null

This is a slowly changing dimension type 2. Changes require review.

Emit OpenLineage events with namespace set to aws:123456789012:us-east-1 and name set to the ARN. At ingest, look up the ARN in the crosswalk and attach a logicalId property. If not found, create a new logical ID or flag for review. Here's a snippet:

JSON
{
  "eventType": "COMPLETE",
  "job": {"namespace": "aws:123456789012:us-east-1", "name": "etl-orders"},
  "outputs": [{"namespace": "aws:123456789012:us-east-1", "name": "arn:aws:dynamodb:us-east-1:123456789012:table/orders"}]
}

You can resolve the crosswalk at ingest or query time. Ingest-time is faster but requires re-ingestion when the crosswalk changes. Query-time is flexible but slower. Use ingest-time if the crosswalk changes less than 1% per day; use query-time if you have many consumers with different mappings.

For cross-account metadata access, create an IAM role in each account that trusts the lineage service's account, and use sts:AssumeRole with an external ID. For GCP, use service account impersonation. If you have EU data, run a regional collector and only send anonymized or aggregated metadata to the central store.

Failure modes: Path-only collision. If you use just table/orders as ID, two accounts with the same table name merge. Detection: run a daily reconciliation against AWS Config; if a logical ID has more than one native ID in the same region, alert. Cost: wrong impact analysis. For S3, the ARN is arn:aws:s3:::bucket-name with no account or region, so you must enrich with s3:GetBucketLocation and s3:GetBucketAcl to avoid false merges. Missing region: treating us-east-1 and eu-west-1 as the same logical ID without a residency flag. Detection: policy check that any logical ID with EU data has no non-EU observation regions. Cost: GDPR fine. Stale crosswalk: a new account isn't mapped. Detection: crosswalk resolution rate drops below 99% for an hour. Cost: lineage breaks, incident response slows.

Monitor coverage: compare the number of native IDs in lineage to the total resources from AWS Config. If coverage drops below 95%, alert. Test moves, replication, shared services, and deletion/recreation. For deletion/recreation, mark deleted resources as inactive; when a new resource with the same name appears, create a new node. If you don't, you get false lineage.

The result is a graph where you can query by logical ID to see cross-account flow, and by native ID to debug a specific resource.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-20

Design lineage for an ML model and feature pipeline.

Answer

Assumptions: one feature store (Feast) over an offline store on Delta or Iceberg and an online store on Redis; training on Spark; orchestration in Airflow; models in the MLflow registry. Without a feature store, the warehouse table plays the feature-view node and nothing else changes.

Core answer

Lineage here is a directed graph, not a document. Nodes are datasets at a version, jobs and runs, feature views, model versions, and deployments. Edges are READ and WROTE. You get it by emitting an event at every job boundary, not by asking teams to document themselves. Three sources, joined on the run ID:

  • OpenLineage events from the Spark listener (registered via spark.extraListeners) and the Airflow provider, landed in Marquez or DataHub.
  • The Feast registry for feature definitions and materialization runs.
  • The MLflow registry for model versions and the training run that produced each one.

What each node pins

NodeIdentityVersion pin
Offline datasetnamespace://tableDelta VERSION AS OF or Iceberg snapshot ID
Feature viewproject/feature_viewregistry hash + materialization interval
Training runMLflow run_idgit SHA, image digest, params
Model versionmodel_name/versionsource run_id, alias
Deploymentservice + revisionmodel version, feature-view hash

A single training run's record, which is what the graph stores per node:

run_id: 8f3c...        (dag=train_ranker, task=fit, try=1)
  inputs:
    delta://prod/orders@v412      snapshot 2024-06-11T02:00Z
    delta://prod/labels@v88
    feast://prod/fv_orders_7d     registry_hash=a91c
  outputs:
    mlflow://ranker/version=37
  code:  git 4b2e1d9, image sha256:9c1f...
  params: lr=0.05, max_depth=8
  metrics: ndcg@10=0.412  (eval delta://prod/eval@v19)

Events are append-only; the store folds them into a graph. Blast radius is a reverse traversal from a dataset to every run that read it, then forward to every model version and deployment those runs produced. "Which models break if orders changes?" is one traversal, not a meeting.

Trade-offs

Feature-store registry + materialization logSeparate metadata graph (OpenLineage → Marquez/DataHub)
Coversfeatures onlyevery job, including non-ML ETL
Setup costnear zero if Feast already runsan emitter per engine
Cross-domain blast radiusnoyes
Freshness evidenceexact materialization timestampsonly as good as emitter coverage

Deciding criterion: if more than one engine writes the tables feeding your features, or you need to answer the upstream-change question above, run the separate graph. One Spark job and one feature store, and the registry alone is enough.

Failure modes

  • Silent feature drift: a feature's distribution moves with no code change. Detect with PSI between the training window and the serving window; by convention PSI above 0.2 on a monitored feature pages. Lineage names the models that consumed it.
  • Stale materialization: the online store serves a value older than the feature view's freshness SLA. Compare max(event_timestamp) in the online store against now() per feature view; Feast's materialization log gives the last successful run.
  • Unreproducible training run: the run pinned a table name but no version, so a re-run yields different metrics. Detect by re-running from the recorded inputs and diffing the metric; a dataset facet with no version means the run is not reproducible.
  • Training/serving skew: batch and online values disagree for the same entity key. Sample 1,000 keys, compute both, alert above a 0.1% mismatch rate.

Retention and access

Version pins expire. Delta's delta.logRetentionDuration defaults to 30 days and delta.deletedFileRetentionDuration to 7 days; Iceberg's history.expire.max-snapshot-age-ms defaults to 5 days. Past those windows the pin dangles: either extend retention or store the snapshot's file manifest alongside the pin. Store dataset identity and column names, never rows; hash join keys so the graph itself carries no PII.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-12

Secure catalog and lineage metadata.

Answer

Assumptions I'd state first: a multi-tenant catalog (DataHub, OpenMetadata, or Unity Catalog) fronting Snowflake or BigQuery; three personas. Platform admin, data engineer, analyst; column-level lineage ingested from dbt/OpenLineage; payment and HR tables in PCI/GDPR scope. If the catalog is single-tenant and read by one team, most of this collapses to "redact at ingestion and stop."

The answer: classify metadata into tiers, then enforce the tiers at every read path through one policy function. Lineage is a read path, not a diagram.

TierExamplesDefault
Existencedataset name, owner, platform, domainvisible to all employees
Structurecolumn names, types, schemateam-scoped
Contentsample rows, SQL literals, descriptions with examplesrole + purpose gated
Derivedrow counts, freshness, quality scoresteam-scoped
Graphlineage edges, column mappingschecked per node

Existence visible by default is deliberate: hiding table names kills discovery and people rebuild the pipeline in a spreadsheet. The exception is the handful of datasets where the name is the secret (hr_salary_dispute_2024); those get a hidden flag and a request route.

Where enforcement lives. DataHub's metadata policies are evaluated in its GraphQL layer; Unity Catalog enforces column masks and row filters in the query engine; BigQuery enforces policy tags at query time, not in the catalog UI. Pick one chokepoint and make every surface: search, autocomplete, entity page, lineage API, export, the write path (DataHub's MCP): call it. A new export endpoint is a new hole.

The trade-off worth saying out loud: redact at ingestion vs. ACL at read.

  • Redact at ingestion (drop sample rows, strip literals from SQL before indexing): one place to enforce, irreversible, and it breaks the debugging and ML-audit use cases that justified the catalog.
  • ACL at read: data stays intact, but every read path must enforce, and one missed path leaks everything.

Deciding criteria: if the catalog is the only consumer and retention is short, redact. If BI tools and notebooks read the same store, ACL, and then the catalog is not your security boundary, the warehouse is.

Failure modes, with the one that bites hardest.

Lineage inference. Analyst ana has VIEW on analytics.orders_clean and nothing else. The request shape is roughly:

GET /lineage?urn=analytics.orders_clean&direction=UPSTREAM&depth=3

Graph: raw.stripe_charges (tagged PII.Sensitive) → orders_clean → analytics.orders_clean, plus raw.shopify_orders → orders_clean.

Naive implementation authorizes the root and returns the subgraph: 4 nodes, 2 of which ana cannot view, including the column edge raw.stripe_charges.card_last4 → analytics.orders_clean.card_last4. The permission on the root leaked the upstream schema.

Correct implementation authorizes the root, then evaluates VIEW per node; unauthorized nodes are dropped, and the edge is dropped too unless existence is broadly visible, in which case it renders as a redacted placeholder with no columns and no owner.

Detection: emit nodes_returned and nodes_authorized per lineage call. Alert when nodes_returned > nodes_authorized for one caller more than 5 times in 10 minutes: that is someone walking the graph. Cost: per-node authorization turns one query into N; cap depth at 3 and fan-out at 50, and cache the decision per (user, urn) for the request.

The other four, briefly: search snippets (a description containing a literal. Regex-scan indexed text before indexing and block the write); counts ("3 tables match 'ssn'" leaks existence. Compare returned count to authorized count); autocomplete (prefix search over column names, same policy function); exports (CSV bypasses field ACLs. Route exports through the same function, not a separate code path).

Keep the request route. If content is hidden with no way to ask, people copy it into a shadow catalog. A "request access" button that files a ticket with the dataset URN costs little and keeps the hidden set honest.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-13

Run impact analysis for a breaking schema change.

Answer

Core answer (first 90 seconds)

First I'd pin down what "breaking" means, because it decides the method. Three cases: a rename or drop, where consumers referencing the name fail at parse time; a type narrowing, which fails at runtime and is sometimes silently coerced; and a semantic change with the same name and type, where nothing fails at all. That third one is the dangerous one.

I'd assume a Snowflake warehouse, dbt for transformation, Airflow for orchestration, and Kafka with Avro plus Schema Registry for streaming. Then I'd answer with three evidence layers, because no single one is complete: declared lineage, observed lineage, and human confirmation.

Declared lineage is the dbt manifest plus OpenLineage events from Airflow. Fast, complete for anything that ran through the orchestrator, blind to everything that didn't: ad-hoc queries, BI extracts, notebooks, a service holding a JDBC connection.

Observed lineage is what actually read the column. In Snowflake that's ACCESS_HISTORY in SNOWFLAKE.ACCOUNT_USAGE, which records DIRECT_OBJECTS_ACCESSED and BASE_OBJECTS_ACCESSED per query and lags live queries by up to 2 hours. In BigQuery, INFORMATION_SCHEMA.JOBS_BY_PROJECT keeps 180 days. This catches ad-hoc consumers; it misses anything that hasn't run inside the retention window.

Human confirmation is each dataset owner signing off. It's the only layer that catches a consumer that runs quarterly.

Worked trace: rename analytics.orders.customer_id to cust_id

  1. dbt ls --select source:raw.orders+ --output name returns 14 models. That's the declared blast radius.
  2. Query observed use over 30 days:
SQL
select distinct query_id, user_name
from snowflake.account_usage.access_history,
lateral flatten(input => base_objects_accessed) f
where f.value:"objectName"::string ilike '%ORDERS%'
  and query_start_time > dateadd(day, -30, current_timestamp());

Say that returns 41 distinct users, 9 of whom are not in the dbt DAG. Those 9 are what declared lineage missed. 3. Rank the 23 total consumers. Of the 9 ad-hoc ones, 3 are a finance extract that runs monthly and 6 are one-off analyst queries last seen 26 days ago. The monthly extract is the real risk: it won't fail until the 1st.

Choosing a mitigation

Dual-publish (write both customer_id and cust_id) costs storage and a second write path; it's right when consumers can't move on your schedule: a vendor feed, a quarterly extract. A compatibility view (create view orders_v1 as select ..., customer_id as cust_id) costs nothing to write and is right when consumers are SQL-only and you own the warehouse. Don't migrate at all when the column is read by a system you can't change and the change buys you nothing but tidiness.

Failure modes

  • Silent breakage: a consumer doing select * into a Parquet extract doesn't error, it just gets a different column set. Detect by diffing the consumer's output schema, not by watching for errors.
  • Stale lineage: the dbt manifest reflects the last deploy, not the last run. A model deleted from the repo still has consumers.
  • Schema Registry default: BACKWARD lets you remove a field and old consumers break. BACKWARD means new consumers can read old data, not the reverse. For a producer-side change you want FORWARD or FULL.
  • Unowned datasets: if no owner responds in 5 business days, treat it as a consumer and keep the compatibility view.

What would change my answer

If the column sits in a table with a dbt model contract or a data contract, the declared layer is authoritative and I'd skip the telemetry sweep. If it's a streaming topic, the registry compatibility check is the gate, not the warehouse query log.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-14

Use lineage during a data-quality incident.

Answer

In the first two minutes

Assume the incident is "a downstream number is wrong" and I have a lineage graph plus run metadata. Lineage's job here is to bound the blast radius and rank candidate causes, not to prove the cause. I use it in both directions: backward from the bad dataset to the runs, code and upstream tables that could have produced it, and forward to everything that consumed it, so I know who to warn and what to freeze.

The graph is a hypothesis, not evidence. Edges are stale, table-level, or missing exactly where the incident is. Every edge I act on gets confirmed against a run record or a query log before I name a cause.

Why lineage behaves this way

Two axes matter: granularity and provenance.

  • Table-level edges come from SQL parsing or from runtime input/output capture. Cheap and near-complete, but imprecise: a SELECT * join makes every column of the source look like a dependency.
  • Column-level edges come from parsing the SQL (DataHub, dbt) or from query-plan analysis. Precise, but only for the dialects and tools someone has actually wired up.
  • Runtime edges: OpenLineage RunEvents emitted by Airflow, Spark or dbt and stored in Marquez or DataHub: reflect what actually ran. Static edges reflect what the code says should run. They diverge exactly when someone hot-fixed a job, ran a backfill by hand, or a task was skipped.

Edges go stale because nothing invalidates them: a renamed column, a swapped source in a config, a job now reading a table the parser never saw. Graph freshness is itself something to check.

Worked trace (figures hypothetical)

Incident: fct_orders daily row count is 38% below its trailing 7-day median.

  1. Pin the dataset version/partition for the affected day, the producing run id, and that run's run_results.json and OpenLineage RunEvent.
  2. Backward: parent_map from the dbt manifest lists stg_orders and stg_payments. The runtime lineage for that run shows only stg_orders was read: the stg_payments edge is static-only, so it is a false lead.
  3. stg_orders backward → raw.orders (Kafka → S3 landing). Runtime shows the extract task ran, but its input file count is 12 against a typical 40.
  4. Forward: child_map gives 6 downstream models, 2 dashboards, 1 ML feature table. Freeze those.

Cause candidate: the upstream extract, not the transform. Confirmed by the file count, not by the graph.

Trade-offs

choicewins whencost
Table-level onlyfast triage, wide fan-outfalse positives from shared staging tables
Column-levelnarrowing to the exact columncoverage gaps, parser lag
Runtime (OpenLineage)reflects what ranonly as good as instrumentation; skipped tasks emit nothing
Static (dbt manifest)complete for dbt modelswrong after manual runs

Deciding criterion: if the symptom is "a number is wrong", go column-level; if it is "a table is empty", table-level is enough.

Failure modes

  • Fan-out explosion: a shared dim_date makes 200 datasets look affected. Detect by checking whether the edge is column-level and whether the value actually changed.
  • Missing instrumentation: a hand-run backfill leaves no OpenLineage event, so the graph says "no upstream ran". Detect by comparing run counts against scheduler expectations.
  • Stale edge: a renamed source, graph still pointing at the old table. Detect by validating edges against query logs.

Then contain or restate outputs, reconcile the corrected run and downstream caches, and file the missing edge as a lineage bug rather than a note in the incident doc.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-15

Use lineage for a privacy deletion request.

Answer

First 90 seconds. Ask which regime and which identifier. Assume GDPR Art 17, subject = account_id 8842, one controller, one month to respond under Art 12(3), extendable by two. Lineage answers one question: where could this person's data be? It produces the candidate set of datasets and columns. It deletes nothing and it is not evidence of completeness. So the shape is: enumerate from lineage, delete at each store against a versioned ledger, then verify by re-querying. If the request is CCPA/CPRA instead, the clock is 45 days, extendable once by 45.

How the list is actually built. Emit OpenLineage events from the orchestrator and the compute engines (openlineage-airflow on the DAG, the Spark listener, the dbt integration on model runs) and land them in Marquez, DataHub or OpenMetadata. Each event carries a dataset facet and, where the integration supports it, a column-level facet. That yields edges like raw.events → staging.events → mart.user_sessions, and column edges like raw.events.payload.email → mart.user_sessions.email. Column lineage is what separates a copy from a derivation.

Worked trace, account_id 8842.

edgemechanismaction
raw.events (Kafka, cleanup.policy=compact)Spark ingest_events, 02:00 UTCtombstone key 8842
staging.eventsIceberg v2, merge-on-readDELETE ... WHERE account_id = 8842
mart.user_sessionsdbt modelrebuild partition, then delete
exports.crm_syncAirflow → Salesforce APIdelete via API, keep the receipt
ml.features_v3feature storedelete feature row, invalidate the model

A Kafka tombstone is a null value on the compacted topic. delete.retention.ms defaults to 86400000 ms (24 h), so the tombstone itself is purged a day later and the key is gone:

Python
producer.send("raw.events", key=b"8842", value=None)  # tombstone
SQL
-- Spark 3.5 / Iceberg
DELETE FROM prod.staging.events WHERE account_id = 8842;

Where lineage is not enough. Lineage sees the copies and transforms it was instrumented for. It does not see a join that re-derives identity from ip + user_agent (inference), an aggregate that is personal data only at small counts, a CSV someone pulled to a laptop, or a SaaS vendor with no integration. Those come from the Art 30 processing record and from asking each system owner. Lineage alone suffices only when every write path is instrumented and the source is the sole origin: rare outside a small, fully dbt-managed warehouse.

Failure modes. Identity error: matching on email deletes a shared mailbox's data. Verify against a second identifier before any delete fires. Anti-resurrection: a backfill or a replayed topic re-materialises the row, so the ledger must be applied at read time or the source deleted first. Immutable backups (S3 Object Lock, compliance mode) cannot be edited: that is an Art 17(3)(b) legal-obligation exception, documented, not silently skipped. Verification: re-run the lineage query and assert zero rows per store; a deletion you cannot re-query is not verified.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-16

Retire a dataset using catalog and lineage evidence.

Answer

The 90-second version

First I'd pin down what "retire" means, because it sets every other date: stop new dependencies, stop reads and writes, or delete the bytes. Those are three different milestones. I'd assume a warehouse table with a catalog entry, an owner, and at least one consumer, and I'd ask whether a contract or regulation sets a retention floor.

The answer is that the catalog tells you who should be using it and telemetry tells you who is. Lineage edges point producer → consumer, so forward (downstream) lineage answers "who breaks if this goes away", and reverse (upstream) lineage answers "what do I have to keep or re-point". Anything that shows up in telemetry but not in lineage is a shadow consumer, and that set is what actually causes incidents.

Then the sequence: freeze new dependencies, announce a dated deprecation, migrate, revoke, delete, and keep watching for a while after.

Why the direction matters

DataHub stores an UpstreamLineage aspect on each dataset; downstream is a reverse index over those edges. A downstream traversal is therefore a fan-out query, and on a hub table it can be expensive: bound it by depth and by column. Column-level lineage is the part people skip: a table can be a pass-through for one column and the sole source for another, and retiring the whole table because the first column is unused is how you break a finance report.

Evidence, with its expiry

sourcewhat it proveslatencyretention
DataHub / OpenLineage graphdeclared consumers, column-levelminutes, event-drivenas long as you keep the graph
Snowflake ACCOUNT_USAGE.ACCESS_HISTORYactual reads and writes, per userup to 3 h365 days
BigQuery INFORMATION_SCHEMA.JOBS_BY_PROJECTreferenced_tables per jobminutes180 days
Postgres 16 pg_stat_all_tables.last_seq_scan / last_idx_scanlast read per tablereset on restartsince last stats reset

That table is the argument for the length of the deprecation window: you cannot claim "no reads in 200 days" from BigQuery JOBS, because it only keeps 180.

Finding the shadow consumers

SQL
SELECT DISTINCT q.user_name, o.value:objectName::string AS object_name
FROM snowflake.account_usage.access_history q,
     LATERAL FLATTEN(input => q.base_objects_accessed) o
WHERE q.query_start_time >= DATEADD(day, -90, CURRENT_TIMESTAMP())
  AND o.value:objectName::string ILIKE 'ANALYTICS.PUBLIC.ORDERS%';

base_objects_accessed catches views and CTEs that direct_objects_accessed misses: the difference between finding the dashboard and finding the view the dashboard reads.

Trade-offs

Soft-deprecate versus hard-delete: mark the catalog entry deprecated (DataHub's deprecation aspect, dbt's deprecation_date model config) and keep the bytes when the data is not reproducible from upstream or a contract requires it; delete when it is reproducible and storage or blast radius argues for it. Emit the state change through OpenLineage's LifecycleStateChangeDatasetFacet (CREATE, DROP, OVERWRITE, RENAME, ALTER, TRUNCATE) so downstream catalogs update without a manual sweep.

Rollback window: size it to the cheapest restore path, not to what feels safe. If the table is rebuilt nightly from an upstream source, the window is one day. If it is the only copy, the window is the retention floor.

Failure modes

  • Catalog-only sweep. Lineage is only as complete as the emitters. A notebook reading through a service account with no OpenLineage integration is invisible.
  • Revoking a shared credential. The service account that read the retired table also reads three live ones.
  • Deleting before the producer. You lose the lineage record that proves what the table was.
  • Quiet period shorter than telemetry retention. It proves nothing about the period before it.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-21

Measure catalog and lineage quality.

Answer

What I'd say in the first two minutes

"Quality" only means something relative to the decisions the catalog is used for. At staff level those are three: impact analysis before a schema change, discovery (can an analyst find the right table), and access review. So I'd split the scorecard into coverage metrics, which are cheap and gameable, and outcome metrics, which are expensive and honest, and report both: coverage alone will be gamed.

Assumptions I'd state up front: a warehouse like Snowflake or BigQuery, lineage harvested via OpenLineage from dbt and Airflow plus SQL parsing (sqlglot) for the rest, catalog is DataHub or OpenMetadata. Tier-1 means revenue-bearing or PII-bearing.

Coverage metrics, with thresholds

  • Owner coverage on Tier-1 assets ≥ 98%. Anything unowned is a finding, not a metric.
  • Freshness: 95% of Tier-1 tables re-harvested within 24h of a DDL change. Track harvest lag as p50/p95, not mean.
  • Orphan rate: tables with no upstream and no downstream edge that are queried at least once a week. Those are lineage gaps, not roots. Target under 2% of Tier-1.
  • Sensitive-column coverage: fraction of PII-tagged columns that carry a classification and a downstream consumer list. Target 100% on Tier-1.

Outcome metrics

  • Change-impact miss rate: replay the last N schema changes and count how many broke a downstream job that lineage didn't flag. If lineage flagged 40 of 43 breaks, recall is 0.93. This is the number that matters.
  • Search success: fraction of searches ending in a query or a "used this table" click within 10 minutes.
  • Reuse lead time: median days from a table being published to its second distinct consumer team.

Trade-offs

choicewinscosts
coverage metricscheap, daily, catch connector rotgameable: owner set to a service account passes
outcome metricsreflect real decisionslag by weeks, need incident history
automated lineage (SQL parse)full coverage, no samplingbrittle to dynamic SQL, over-reports edges
sampled validationground truth from query logs200 edges/domain/week gives only ±3% at 95% confidence

That last row is the arithmetic: with n=200 and p=0.95, the standard error is sqrt(0.95×0.05/200) ≈ 1.5%, so the 95% interval is about ±3%. To detect a drop from 0.95 to 0.90 at 80% power you need roughly 430 samples per domain. That's the deciding criterion: sample size follows the smallest regression you care about, not the budget.

Failure modes and how I'd detect them

  • Stale harvest: a connector silently stops. Compare max(harvest timestamp) per source against expected cadence; alert at 2× cadence.
  • Gaming: owners bulk-assigned to a shared account, or lineage "fixed" by deleting edges. Track owner churn and weekly edge-count deltas; a 30% drop in edges is a red flag.
  • Lineage drift after a dbt refactor: a model is renamed and its edges orphan. Detect via an orphan-rate spike in the affected domain.
  • Change-impact miss: the cost is a broken dashboard found by an exec, not by the pipeline.

What would change my answer: if the catalog is used only for discovery, drop lineage precision entirely and spend the budget on search success and freshness.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-22

Migrate from one catalog or lineage platform to another.

Answer

What I'd say in the first two minutes

First I'd pin down scope: which platform is the source, which is the target, and whether we're moving metadata only or also the lineage graph and the access-control model. Take the concrete case: source is Apache Atlas 2.3 (Hive and Kafka hooks feeding lineage, JanusGraph backend), target is DataHub (GMS plus Elasticsearch for search, graph service for lineage), roughly 40k datasets and 250k lineage edges, two-week dual-write window before cutover. Those numbers are illustrative, but they set the plan's shape.

The thing that decides the migration is that identity and lineage don't move the same way. Atlas identifies an entity by a server-assigned GUID and stores lineage as relationships between entities in its graph. DataHub identifies a dataset by a URN derived from platform and name, urn:li:dataset:(urn:li:dataPlatform:hive,db.table,PROD), and stores lineage as aspects on that URN. You cannot copy GUIDs across; you re-derive identity from the natural key (platform + qualified name) and rebuild every edge against the new URNs. If the natural key is ambiguous, two Hive tables with the same name in different clusters, the edge silently attaches to the wrong node.

So the order is: entities first, then lineage, then glossary/ownership/policy, then consumers.

Loss map

Build this table before writing code, because the target model is narrower in places.

Atlas conceptDataHub targetLoss
Entity GUIDURN from platform+nameGUID not preserved; store as custom property
Classification (e.g. PII)Tag / GlossaryTermTag propagation rules differ
Business metadataCustom / structured propertiesFree-text fields may not map
Lineage relationshipUpstreamLineage aspectColumn-level edges only if source had them
Audit / entity historyNot modelledExport raw, keep provenance

Anything unsupported goes to a raw export (the Atlas REST v2 dump) plus a provenance record, so nothing is silently dropped.

Dual-ingest vs wave cutover

Two credible strategies. Dual-ingest: run both platforms' ingestion against the same sources for a window, so the target is continuously rebuilt and you can diff. Wave cutover: freeze a domain, export, load, verify, move consumers, repeat. Dual-ingest costs you running two systems and reconciling drift; it's right when lineage changes daily and consumers depend on freshness. Wave cutover is cheaper and gives clean per-domain rollback; it's right when the graph is mostly static and you can freeze edits. I'd dual-ingest the top 5 critical domains and wave-cut the long tail.

Reconciliation

Per domain, compare counts and sample semantics:

  • entity count: source 12,400 Hive tables → target 12,400 URNs; a mismatch means dropped or duplicated natural keys.
  • edge count: source 250k edges → target within ±0.5%; a shortfall usually means edges whose endpoints failed to resolve.
  • sample precision: pull 200 random edges, check each against the source; below ~98% precision means the natural-key mapping is wrong.

Then test the workflows that matter: search returns the table, access requests resolve, impact analysis from a column shows the same downstream set.

Failure modes

  • Orphaned edges: an edge whose endpoint URN didn't resolve. Detect by counting edges with a missing endpoint after load; they show as lineage that stops mid-graph.
  • URN collisions: two source entities mapping to one URN, silently merging. Detect by asserting target entity count equals distinct natural keys.
  • Stale lineage: dual-ingest lag means the target shows yesterday's graph. Detect by comparing max event timestamp per domain.
  • Policy loss: Atlas classifications that gated access don't carry, so a table becomes readable. Detect by diffing the access-control set before cutover.

Cutover

Freeze or sequence edits per wave, remap URLs and IDs in downstream integrations (BI tools, ticketing), migrate audit history only as far as the target allows, and keep the raw export plus a vendor-independent dump so rollback doesn't depend on the source platform still existing.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-23

Assign ownership for catalog metadata and lineage.

Answer

Assumptions I'd state first: roughly 2,000 tables across one warehouse and one lake, dbt for transforms, Airflow for orchestration, OpenLineage as the lineage transport, DataHub as the catalog, five domain teams with at least one analytics engineer each.

The answer: Split ownership along two axes, because metadata is asserted and lineage is derived. Different truth sources, different owners.

Metadata: the domain data owner is accountable for purpose, permitted use, quality and lifecycle of their tables. The steward maintains definitions, glossary terms and the issue workflow. The platform team owns connectors, identity normalization, the event service and catalog availability: never business meaning. Security and privacy govern sensitive views. Consumers file defects.

Lineage: pipeline-level lineage (job A writes table B) is owned by the producing team, because they run the job and instrument it. Column-level lineage is owned by the domain owner of the downstream table, because only they can adjudicate whether their customer_id means the same thing as upstream's. A central authority owns the standard (the OpenLineage event schema, naming, tiering) and arbitrates cross-domain conflicts.

Why the split: a SQL parser can derive an edge; it cannot derive meaning. Automation that overwrites owner-authored semantics silently destroys the only reason stewards curate.

Trade-off: federated vs centralised. Federated (each domain owns its slice) wins above roughly five domains with an engineer each: it scales, and the owner sits close to the data. Centralised wins below three domains or under heavy regulatory scope (BCBS 239, GDPR Art. 30), where one team can hold the whole map. Deciding criteria: number of domains, regulatory exposure, headcount. Most companies land on federated with a thin central standard-setting function.

Failure modes.

failuredetectioncost
Lineage ownership unassignedOpenLineage event volume for a job drops to zero while the job still runs; catalog shows last-emitted > 24hA stale column edge lets a PII column reach a mart undetected: a re-identification review, not a bug fix
Automation overwrites owner semanticsCatalog audit-log diff on human-authored description/tag fieldsStewards stop curating; the catalog becomes a mirror of the parser
Catalog admin owns business truthDefinition-change PRs approved by non-domain reviewersA wrong definition propagates to every consumer

Example SLOs (targets, not vendor defaults): Tier-1 table has a named owner within 5 business days of creation; pipeline-level lineage emitted within 15 min of job completion at p95; column-level coverage on Tier-1 tables ≥ 90%; steward responds to a definition dispute within 3 business days.

Trace: a column rename. stg_orders.cust_id becomes customer_id. The dbt run emits a manifest; OpenLineage updates the column facet. If the downstream owner hasn't claimed customer_id, the catalog shows an unmapped column and the PII tag does not propagate. A nightly check counts unmapped columns on Tier-1 tables; above 5% it opens a ticket to the domain owner, who has 3 business days to map or reject.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-24

Test a catalog and lineage system before production.

Answer

What I'd say first

I'm assuming "test" means testing whether the catalog's claims are true, not testing the catalog software's uptime. A catalog is a derived store: it ingests from warehouses, query logs, dbt manifests and orchestrators, and everything it shows is a projection of those sources. So the test is whether I can falsify its answers.

Three things decide whether it's safe to put in front of engineers: identity, lineage edge accuracy, and freshness. The rest is variation on those.

Identity is the root failure

Lineage edges are keyed on something. If the key is the fully-qualified name, a rename is a delete plus a create and every edge dangles. If the key is a stable URN assigned at first sight, a rename is a metadata update and the graph survives.

Worked trace (hypothetical, catalog keyed on FQN):

  1. analytics.orders has 12 recorded downstream edges.
  2. ALTER TABLE analytics.orders RENAME TO analytics.orders_v2; runs in Snowflake.
  3. The next harvest sees orders_v2, creates a new node with 0 downstream edges. The old node keeps its 12 edges and now points at a table that no longer exists.
  4. Impact analysis for dropping a column on orders_v2 returns zero consumers. The real number is 12.

Detection: after any rename, assert the new node's downstream count equals the old node's within one harvest cycle. That assertion is the whole test, and it runs cheaply in CI against a staging catalog.

Identity collision is the same bug from the other direction: two tables named orders in two accounts collapse into one node, and you see 40 upstreams that are really two sets of 20. Detect by counting distinct source systems per node: a node with upstreams from two accounts means the key isn't unique enough.

Lineage accuracy: pick the fidelity you can defend

Table-level lineage from query logs is cheap and survives almost anything. Column-level lineage parsed from SQL is what answers "if I drop this column, what breaks", but it fails silently on dynamic SQL, Jinja templating and EXECUTE IMMEDIATE, where there is nothing to parse.

Deciding criterion: what decision does the edge drive? Breaking-change review needs column-level on join and filter keys. Ownership routing needs table-level only. Don't pay for column-level everywhere.

Sampling: pull 200 edges and check each against the source query text or the dbt manifest. At n=200 you resolve the error rate to roughly ±2 percentage points at 95% confidence, so a vendor's "99% accurate" claim is untestable at that size. Sample 400+ when the number matters, and stratify by source system: parse failures cluster in the dynamic-SQL sources rather than spreading evenly.

Freshness and failure telemetry

Measure harvest lag as p95 of (source change commit time → visible in catalog). If the harvester runs hourly and your incident SLA is 15 minutes, the catalog cannot be the on-call source of truth, and no amount of testing changes that: you shorten the interval or you scope the catalog to non-incident use.

failuresignalblast radius
Orchestrator retry produces two harvest events for one source changeduplicate edge counts on a nodeinflated fan-out, wrong impact analysis
Backfill rewrites a partition, catalog stores current state onlylineage for a date range returns emptyhistorical audits can't be reconstructed
Consumer account can't read producer metadatanode with zero downstreams that has known consumersedges stop at the account boundary

What I'd skip

Testing every asset. Rank by downstream fan-out × criticality, test the top 20, and let the long tail ride on the same code paths.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-25

Evaluate whether lineage is sufficient for a risky decision.

Answer

Verdict: lineage is necessary, not sufficient. The reason is structural. Lineage is built from what producers emit, not from what consumers do. Every edge in the graph exists because some job was instrumented to declare it. A consumer that reads your table through dynamic SQL, a BI extract, a reverse-ETL sync, or a Python script nobody wired up to OpenLineage is invisible, and invisible reads are exactly the ones that break.

So the test isn't "do I have lineage?" It's four questions:

  1. Is it column-level, not table-level? Table-level lineage tells you fct_orders depends on orders; it cannot tell you whether dropping orders.legacy_status matters.
  2. Is it fresh? Compare the last emission timestamp per dataset against the producing job's last successful run.
  3. Does it cover every consumer, including ones outside the warehouse?
  4. Is the action reversible?

If all four hold, lineage is enough and you ship. If any fails, lineage is a starting point and you need corroboration.

Why it undercounts

Lineage is opt-in per job. The OpenLineage spec has a columnLineage facet, but a job only contributes it if the integration emits it: the Airflow provider has to be configured, the Spark listener has to be attached, and dbt's manifest.json gives you model-level edges from ref() and source() while column-level requires parsing compiled SQL or the catalog artifact. Anything that doesn't go through an instrumented path contributes nothing, and the graph looks complete anyway.

sourcewhat it provescoveragefreshnesscost
lineage graph (OpenLineage, dbt manifest)declared producer→consumer edgesonly instrumented jobsas fresh as last emissionfree, already there
query logs (Snowflake ACCESS_HISTORY, BigQuery JOBS_BY_PROJECT)actual reads, by user and queryeverything that hit the warehouse365-day / 180-day retentioncheap; misses external consumers
contracts / owner attestationintent and deprecation commitmentsonly teams that signedmanualslow, high trust
reconciliation (row counts, checksums)whether output actually changedthe tables you checkper runcompute

Worked example: dropping analytics.orders.legacy_status

Lineage from dbt's manifest plus the Airflow OpenLineage provider shows three downstream models reading orders. Verdict from lineage alone: safe to drop.

Query logs disagree. ACCESS_HISTORY over the last 90 days shows seven distinct query hashes touching that column: the three dbt models, a Looker service account, a reverse-ETL job syncing to Salesforce, and two ad-hoc analyst queries. Lineage coverage is 3/7 = 43%; the residual blind spot is 57% of readers, and one of them writes to a system of record.

Decision: not a drop. Rename to legacy_status_deprecated, dual-write for 30 days, watch ACCESS_HISTORY until the column shows zero readers, then drop. Cost is one extra column and a scheduled job for a month, against a broken Salesforce sync.

Failure modes and how you catch them

  • Static parsing misses dynamic SQL. A dbt model using {{ var('col') }} or a Spark job assembling SQL from a config table produces no edge. Detect: diff lineage edges against query-log edges for the same window; the gap is your blind spot.
  • Stale graph. The DAG changed, the emission didn't. Detect: alert when a dataset's last lineage event is older than the producing job's last successful run.
  • Table-level lineage read as column-level. Detect: check whether the edge carries a column mapping. If it doesn't, treat it as unknown, not safe.
  • Semantic change with identical lineage. Renaming a column, changing a filter, or swapping a join key leaves the graph unchanged. Only reconciliation or a contract sees it.
  • Uninstrumented consumers outside the warehouse. Detect: query logs by service account, plus asking owners. Absence of evidence is not evidence of absence.

When lineage is enough

Additive, reversible changes (adding a column, adding a table) with column-level coverage and fresh emissions: ship on lineage alone. Destructive or irreversible ones: drops, type changes, anything feeding a regulatory report or a model you can't retrain cheaply: need query logs plus owner sign-off. The deciding criterion is blast radius times reversibility, not the size of the graph.

Curated: · Written: · Reviewed:

Difficulty: Hard