splitArray
The splitArray operator splits the array that you want to split into rows.
Operator Usage in Easy Mode
Click + on the parent node.
Enter Split Array operator in the search field and select the operator from the Results to open the operator form.
In the Input Table, enter or select the name of the table containing the data to run this operator on.
In the Field, enter or select a field with an array that you want to split into rows.
In the Name of the Field, enter the name of the new field for an array.
Click Run to view the result.
Click Save to add the operator to the playbook.
Click Cancel to discard the operator form.
Usage Details
``` {text}(inputTable: TableReference, field: ColumnReference, nameOfNewField: String)
**Input**:
`inputTable`: The table containing the data to run this operator on.
`field`: Select the field with an array that you want to split into rows.
`name of new field`: Enter the name of the field.
## Example
In the input table, enter the fields that you want to split.
Define the array table as follows:
```scala
array1 as `select array(1, 2) as arrayCol from _Start_Node`
array2 as `select array(3, 4) as arrayCol from _Start_Node`
To combine the columns use the 'unionAll(array1, array2)'
The input table displays the following array column, let's say input table = InputData
arrayCol |
---|
WrappedArray(1, 2) |
WrappedArray(3, 4) |
When you apply the splitArray operator, the output is shown as follows:
splitArray(InputData, $.arrayCol, "splitted")
The output table displays the following split array column.
arrayCol | splitted |
---|---|
WrappedArray(1, 2) | 1 |
WrappedArray(1, 2) | 2 |
WrappedArray(3, 4) | 3 |
WrappedArray(3, 4) | 4 |