name: op-agg-set-union
description: Bitwise-OR a set field across rows; returns labels for every bit set in any contributing row.
kind: operator
category: AGG
operator: AGG_SET_UNION
type: reference
applies_to: process, compose, predict
examples_tags: [cardinality-analysis, cohort-analysis]
Use when
For a multi-select field, every option chosen by at least one row, over all rows or per group.
Questions it answers:
- Which brands were mentioned by anyone in this segment?
- Which features does at least one customer in each plan use?
Use something else:
AGG_SET_INTERSECTIONwhen you want the options every row chose.AGG_SET_FREQUENCYwhen you want how many rows chose each option.
Params
None.
Inputs
field — admitted types: see ## Contract.
Output
JSON array of resolved dictionary labels. Scalar fallback = popcount of the union mask.
Components
mask_union— Bitwise OR across contributing rows; 4 little-endian words,words[0]= bits 0-63popcount— Bits set inmask_unionlabels— Resolved dictionary labels
Contract
- Types (
field):set_*; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED;decimal128isPULSE_AGG_NOT_MEANINGFUL_FOR_DECIMAL. - Weight: no weighted form; an explicit weight is
PROCESSING_CONFIG, an instance default is skipped. - Streaming: streamable; components
mergeable. - Components:
n,n_null,mask_union,popcount,labels.
Gotchas
- Empty mask is a valid “no selection” — distinct from null.
- Union mask only honors bits seen in non-null rows.
- Non-scalar row value: an overlay scoring it (request, Compose or whole-chain:
params.fieldwhere the kind honours it, elseaggregations[0]) is refused (PROCESSING_CONFIG, reasonnon_scalar), as is a chain stage carrying it that feeds another; an unscored one beside a scalar runs.
See
pulse_examples_search tags=[cardinality-analysis]- Skills:
aggregation-design,cohort-schema-design,response-components