Document toolboxDocument toolbox

splitArray

The splitArray operator splits the array that you want to split into rows.

Operator Usage in Easy Mode

  1. Click + on the parent node.

  2. Enter Split Array operator in the search field and select the operator from the Results to open the operator form.

  3. In the Input Table, enter or select the name of the table containing the data to run this operator on.

  4. In the Field, enter or select a field with an array that you want to split into rows.

  5. In the Name of the Field, enter the name of the new field for an array.

  6. Click Run to view the result.

  7. Click Save to add the operator to the playbook.

  8. 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

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

arrayCol

splitted

WrappedArray(1, 2)

1

WrappedArray(1, 2)

2

WrappedArray(3, 4)

3

WrappedArray(3, 4)

4