graph_traceLineage
Trace object dependencies in Teradata to identify upstream sources and downstream impacts. Supports wildcards, CSV patterns, and configurable depth. Find what breaks if a table changes, or where data comes from.
Instructions
Analyse object dependencies in Teradata. Supports wildcards (%) and CSV patterns.
Hybrid implementation — no stored procedure required. Python constructs Teradata recursive CTEs that execute entirely server-side. Only the reachable subgraph crosses the network — not the full edge table.
Examples: 'DB.Table' (single), '%WBC%.%' (wildcard), 'DB.T1,DB.T2' (CSV)
Finds upstream dependencies (what the object depends on) and downstream dependents (what depends on the object). Returns nodes and edges representing the dependency subgraph.
When multiple patterns are provided via CSV, one upstream CTE and one downstream CTE is executed per pattern. Results are merged and deduplicated by Python before assembly.
Use this for:
Impact analysis: "What breaks if I change or drop this object?"
Lineage tracing: "Where does this data come from?"
Dependency discovery: "What does this object use?"
Pre-deployment validation: checking impacts before making changes
Arguments: object_name - str: Object name pattern(s). Supports wildcards (%) and CSV format. STRING type — not an array.
Single: 'DEV01_StGeo_STD_T.mortgage_account'
Wildcard: '%WBC%.%'
Multiple: '%WBC%.%,%StGeo%.%'max_depth_up - int: Maximum levels to traverse upstream (0-10). 0 = no upstream analysis. Default: 3
max_depth_down - int: Maximum levels to traverse downstream (0-10). 0 = no downstream analysis. Default: 3
exclude_objects - str: CSV LIKE patterns to exclude. Matches against DB.Object format. Example: 'PRD_%,%.temp_%' Default: '' (no exclusions)
include_containers - str: CSV of container LIKE patterns to include (whitelist). Empty = all containers. Default: '' (all containers)
edge_repository - str: Edge repository view/table conforming to the Required parameter — no default.
return_format - str: 'detailed' (default), 'summary', or 'edges_only'
Returns: ResponseType: formatted response with dependency analysis results.
detailed response structure: { "nodes": [...], // Unique nodes (deduplicated) "upstream_edges": [...], // One row per upstream edge "downstream_edges":[...], // One row per downstream edge "summary": {...} // Aggregate statistics }
Edge row fields: DependentObjectDBName, DependentObjectName, FQDependentObjectName, ReferencedObjectDBName, ReferencedObjectName, FQReferencedObjectName, Src_Kind, Tgt_Kind, Depth, DependencyPath
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | ||
| max_depth_up | No | ||
| max_depth_down | No | ||
| exclude_objects | No | ||
| include_containers | No | ||
| edge_repository | No | ||
| return_format | No | detailed |