union
union [@dataset]+
Combines the main pipeline input with every referenced additional dataset into one dataset whose rows are the union of all inputs.
Each argument must be a dataset reference (for example @other) naming a dataset other than the main input. Every input, including the main input, must share the same dataset kind: all Table, all Event, or all Interval. The main input cannot be a Resource.
Column names present in any input appear in the output. For a column missing from a given input, rows originating from that input carry null in that column. Types for the same column name must unify; when a wider numeric type is chosen, values may be cast with possible precision loss.
Valid-from and valid-to fields from Event and Interval inputs are renamed to match the main input’s time column names. Non-time columns on a side input that collide with the main valid-from or valid-to name are dropped from that side with a column-name collision warning.
Primary key, candidate keys, and column constness metadata are cleared on the output. The grouping key is kept only when every input’s grouping-key column set matches (order may differ). Time alignment is preserved only when all inputs share a compatible alignment; otherwise alignment is dropped.
Foreign keys from side inputs are merged in, with source fields rewritten through column renames.
Categories
Accelerable
union is always accelerable if the input is accelerable. A dataset that only uses accelerable verbs can be accelerated, making queries on the dataset respond faster.
Examples
union @months
Stacks the main station rows with months so shared columns merge and missing fields become null on each side.
union @station
Swaps which dataset is the main input so the merged schema still lines up, with null filling columns that exist only on one side.
Updated 19 days ago