any
any(expression: storable) -> expression
Aggregate and window function that returns one value of its argument from each group (or frame). The argument may be any storable scalar type and the result has the same type. The implementation does not ignore nulls, so if nulls appear in the input, the chosen value may be null even when non-null values exist; use any_not_null to skip null picks. The choice is otherwise arbitrary and not guaranteed stable across runs. It is valid only inside grouping or window() contexts, like other aggregates registered through the shared aggregate path.
Domain
This is an aggregate function (aggregates rows over a group in aggregate verbs).
This is a window function (calculates over a group of multiple input rows using windowing).
Categories
Examples
statsby sample_msg:any(body), group_by(trace_id)
Picks one arbitrary non-aggregated body payload per trace_id with any for quick sampling alongside other aggregates.
Updated 19 days ago