Sub topic 4
Tracing upstream and downstream in Catalog Explorer
This chapter assumes you know the Unity Catalog three-level namespace (catalog.schema.table), can open a table in Catalog Explorer, and understand that lineage is captured automatically when queries run. Here you learn to read the lineage graph and use it to answer dependency questions without writing SQL.
Where to find lineage
Open Catalog in the workspace sidebar and browse to a table, for example main.sales.daily_revenue. On the table page, select the Lineage tab. The tab lists upstream sources and downstream targets. Select See lineage graph to open the visual graph.
You only see lineage for tables you are allowed to see. If you lack privileges on a related object, it appears as a restricted node instead of showing its name.
Upstream and downstream
Two directions matter.
- Upstream objects are the inputs. They were read to produce the table you are viewing.
- Downstream objects are the consumers. They read from the table you are viewing.
For daily_revenue, orders and refunds are upstream. The dashboard and monthly_summary are downstream.
Reading the graph
The table you opened sits in the center. Arrows point in the direction data flows, from source to target. Each node shows its type, such as a table, notebook, job, or dashboard.
- Select the arrow-shaped expand icon on a node to reveal the next hop in that direction. Repeat to walk several levels.
- Select a node to see its details. For a notebook or job, you can open the entity that produced the data.
- Use the column selector on the table node to switch to column-level lineage. Selecting a column highlights the source columns that feed it.
The graph is built from the same data as system.access.table_lineage and system.access.column_lineage. A later chapter shows how to query those tables directly.
A worked example
Suppose the revenue column in main.sales.daily_revenue looks wrong. Trace it like this:
- Open
main.sales.daily_revenueand go to the Lineage tab. - Open the lineage graph and expand upstream one level. You see
orders,refunds, and the job that writes the table. - Switch to column view and select
revenue. The graph highlights the contributing columns, such asorders.amountandrefunds.amount. - Open the job node. Check its last run and the notebook code that computes the column.
- Expand
ordersupstream to see whether an earlier job changed its data.
Now suppose you plan to rename orders.amount. Open main.sales.orders, expand downstream, and list every table, job, and dashboard that depends on it. Notify their owners before you make the change.
Common errors
- A table you expect is missing. Lineage only appears after a query runs that reads or writes the data. Run the job once and check again.
- A node shows as restricted. You lack access to that object. Ask its owner, or ask a metastore admin, for the needed privilege.
- The graph looks incomplete. Some paths are not captured, such as reads that do not go through Unity Catalog. A later chapter covers these limits.
- Old dependencies are gone. Lineage is kept for a limited time, so a path last used long ago may no longer show.
Exercise
You plan to drop the column orders.customer_id from main.sales.orders. Which direction do you expand in the lineage graph to find what might break, and why?
Show answer
Expand downstream. Downstream objects read from orders, so they are the ones that could fail if the column is removed. Use column view on customer_id to narrow the list to objects that actually use that column.