trace_lineage
Trace data lineage to see where a table or column's data originates and what depends on it. Use to justify numbers, debug unexpected values, or assess the impact of table changes.
Instructions
Trace where a table or column's data comes from, and what depends on it.
Call this when you need to justify a number, when a value looks wrong and
you need to find where it was computed, or before suggesting a change to a
table so you can say what it would break. Pass column for column-level
lineage. Edges marked model_only mean the SQL could not be parsed down to
the column — the dependency is real, the precision is not.
Args: table: Table name, fully qualified or bare. column: Optional column to trace; omit for table-level lineage. direction: "up" for sources, "down" for dependents, "both" (default). depth: How many hops to follow (1-5).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | ||
| table | Yes | ||
| column | No | ||
| direction | No | both |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | ||
| table | Yes | ||
| column | No | ||
| upstream | No | ||
| direction | No | both | |
| downstream | No | ||
| unresolved_notes | No | Places where column-level resolution failed and why |