RELATED

All functions > ROW > RELATED

Syntactic sugar for EXTEND that adds a single joined feature without wrap/unwrap operations

Syntax

RELATED(base, add, agg_function, groupby)
sql

Arguments

ParameterTypeRequiredDescription
addFEATUREYesArray of features to add (typically one feature)
baseFEATUREYesBase feature to use for binding
agg_functionEMPTYYesOptional aggregation function name for RELATED_AGG variant
groupbyEMPTYYesOptional array of groupby expressions for RELATED_AGG variant

Returns

Expression - The joined feature value

Notes

  • RELATED is syntactic sugar for EXTEND with automatic wrap/unwrap
  • RELATED(joined_feature VIA base_feature) expands to: EXTEND(joined_feature AS joined_field WITH ROW(base_feature AS field_name))[joined_field]
  • Avoids the manual ROW construction and field extraction needed with EXTEND
  • RELATED_AGG variant supports aggregation functions with GROUP BY
  • Will be rewritten to EXTEND/ADD_FIELDS during query processing

Examples

Last update at: 2025/12/05 16:03:14
Last updated: 2025-12-05 16:07:55