@terascope/data-mate / teal-frame/expand-values / ExpandValuesOptions
Interface: ExpandValuesOptions
Defined in: data-mate/src/teal-frame/expand-values.ts:26
SQL for the @expandValues directive, which turns each array element into its own output
row. There are two modes:
correlate: truezips the lists by position: a row produces as many rows as its longest list, and shorter lists are padded with null.correlate: falsestacks the lists: a row produces as many rows as its list lengths add up to. Each field gets its own block of rows, with the other expanded fields null there.
In both modes, a row whose expanded lists are all null or empty is kept as one row with those
fields null (a plain unnest would drop it). Fields that are not expanded are copied onto
every output row. Blocks follow the frame's column order, not the order of fields. The
expanded fields come out with array: false.
It is a single SELECT with no UNION ALL, so row order is kept. Each row unnests a list of
{ k, i } pairs (which field, which position), and each expanded column is field[i] where
k selects it. The pairs have the same type whatever the fields hold, so no element type
has to be spelled out.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
correlate | readonly | boolean | true zips the lists by position; false stacks one block of rows per field. | data-mate/src/teal-frame/expand-values.ts:28 |