resolveQueryLineage
resolveQueryLineageTrace a SQL query's data lineage from direct tables through views and routines to underlying physical tables, enabling impact analysis and data flow understanding.
Instructions
Trace a query's data lineage from direct FROM/JOIN objects through views and optionally routines to underlying physical tables. Use inspectQuery for direct AST references only; routine expansion is best-effort and may miss dynamic SQL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| schema | No | Default schema for unqualified names | |
| maxDepth | No | Maximum recursive expansion depth. Default 5, max 20. | |
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. | |
| expandViews | No | Expand database views and materialized views recursively. Default true. | |
| expandRoutines | No | Expand database functions/procedures referenced by the query, best-effort. Default true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cycles | No | Possible relationship or lineage cycles found during traversal. | |
| maxDepth | Yes | Maximum relationship traversal depth that was applied. | |
| warnings | No | Non-fatal warnings produced while resolving or expanding lineage. | |
| inspection | No | Parsed query inspection that underpins lineage (opaque; the inspectQuery tool returns the typed form). | |
| directObjects | No | Objects directly referenced by the query before recursive expansion. | |
| expandedObjects | No | All resolved objects visited during lineage expansion. | |
| unresolvedObjects | No | Objects that could not be resolved against metadata during lineage analysis. | |
| expandedPhysicalTables | No | Physical tables reached by recursively expanding views and routines. |