Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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

WrappedArray(1, 2)

WrappedArray(3, 4)

When you apply the splitArray operator, the output is shown as follows:

Scala

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

  • No labels