DEPTH_RELATIVE_TO
All functions > METADATA > DEPTH_RELATIVE_TO
Returns the depth of the current feature relative to the given feature in the dependency DAG
Syntax
DEPTH_RELATIVE_TO(feature_ref: VARCHAR) → BIGINT
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
feature_ref | VARCHAR | Yes | Name of the feature to measure depth relative to |
Returns
BIGINT - Depth/distance in the dependency DAG relative to the target feature
Notes
- Returns the graph distance between current and target features
- Positive values indicate current feature is downstream of target
- Negative values indicate current feature is upstream of target
- Returns NULL if features are not related in the DAG
- Works with the feature dependency DAG (Directed Acyclic Graph)
- Useful for ordering features by dependency depth
- Only available in METADATA context (feature queries)
- Measures shortest path in the dependency graph