Spawn¶
Expands an ARRAY value into individual rows, fanning the chain out to one row per element.
Spawn(:array) consumes an ARRAY field and emits one row per element
of the array. The first element becomes the primary result; the
remaining elements become additional results, so downstream rules in
the chain run once per element.
This is the new-mode replacement for the legacy multi-sized result
fan-out: Spawn lets you defer fan-out from the producer (UsagiMap()[],
Use()[N], …) to a later, explicit step that operates on an ARRAY
collected up to that point. Available in new mode only.
Parameters¶
- 1 —
arrayMandatory — accepts: field -
Field reference to an
ARRAY-typed input. Each element of the array becomes one row in the downstream chain.
Input type¶
ARRAY
Output type¶
The element type of the input ARRAY. The rule reports ARRAY from
aggregateType() purely to bypass the parse-time type check;
elements are typed at runtime.
Requires¶
- Exactly one parameter, a field reference to an
ARRAYfield. - The
ARRAYmust contain at least one element at runtime — empty arrays raise a runtime error.
Examples¶
Expand a collected ARRAY into one row per element
Errors¶
-
`Spawn': input must be ARRAY-typed- The referenced field does not hold an
ARRAYvalue at runtime.
-
`Spawn': empty array - no rows to produce- The
ARRAYhad zero elements when the rule fired.
-
Spawn: input:f' must be of ARRAY type`- The referenced field is not declared
ARRAY.
-
`Spawn' is only available in new mode- New mode is not enabled in
etl.conf.
See also¶
Use, CartesianOf, Unique, At, Size