Unique¶
Deduplicates values from one or more inputs; in new mode also flattens ARRAY inputs into one ARRAY.
Unique operates in two modes depending on the input value type.
Scalar mode (any execution mode). With non-ARRAY inputs Unique
runs as a multi-sized aggregator: the first unique value seen across
all input fields becomes the primary result, every subsequent unique
value is emitted as an additional result, and duplicates are dropped.
A per-rule seen set is shared across the row's forks via
contextCache.uniqueValuesByRule, making Unique a useful
convergence point after a multi-sized fan-out.
Array mode (new mode). When any input field is ARRAY-typed, all
inputs must be ARRAY and Unique flattens them, deduplicates the
combined elements, and returns a single ARRAY value rather than
fanning out into rows.
Without parameters Unique consumes every pipeline input. With
Unique(:f1, :f2, ...) it considers only the named fields. All
scalar-mode inputs must share the same value type.
Parameters¶
- N —
fieldOptional — accepts: field -
Field references in
:-notation. When omitted, every pipeline input is considered.
Input type¶
INTFLOATDATESTRINGARRAY
Output type¶
Scalar mode: type matches the (shared) input type. Array mode:
ARRAY containing the unique elements.
Requires¶
- Scalar mode: all inputs must share the same value type (one of INT, FLOAT, DATE, STRING).
- Array mode: all inputs must be ARRAY-typed; only available in new mode.
Examples¶
Multi-sized convergence over two pipeline values (test062)
Use across all pipeline inputs
Array mode — flatten and dedup, then map per element (test085)
Errors¶
-
Unique requires all input fields to have the same type- Scalar-mode inputs of mixed types — combine like-typed inputs only.
-
Unique accepts date, float, integer, and string input only- A scalar input of an unsupported type (e.g.
BOOLEAN).
-
Unique (array mode): all input fields must be ARRAY-typed- A mix of
ARRAYand scalar inputs in array mode.
-
No unique values found - all input values are duplicates- Every value seen by the rule had already been emitted on this row.
-
Unique with ARRAY inputs is only available in new mode- An
ARRAYfield was passed but new mode is disabled.
See also¶
Without, Append, Size, Use, CartesianOf