Supported in: Batch, Streaming
Explode array into a row per value as a struct containing the element's relative position in the array and the element itself.
Expression categories: Array
Type variable bounds: T accepts AnyType
Output type: Struct<Optional[position], Optional[element]>
Argument values:
arrayGiven input table:
| array |
|---|
| [ one, two, three ] |
| [ four, five ] |
Expected output table: | array |
| ----- |
| {
element -> one,
position -> 1,
} |
| {
element -> two,
position -> 2,
} |
| {
element -> three,
position -> 3,
} |
| {
element -> four,
position -> 1,
} |
| {
element -> five,
position -> 2,
} |
Argument values:
arrayGiven input table:
| array |
|---|
| [ one, two, three ] |
| [ ] |
| [ four, five ] |
| [ ] |
Expected output table: | array |
| ----- |
| {
element -> one,
position -> 1,
} |
| {
element -> two,
position -> 2,
} |
| {
element -> three,
position -> 3,
} |
| {
element -> four,
position -> 1,
} |
| {
element -> five,
position -> 2,
} |
Argument values:
arrayGiven input table:
| array |
|---|
| [ one, two, three ] |
| [ ] |
| [ four, five ] |
| [ ] |
Expected output table: | array |
| ----- |
| {
element -> one,
position -> 1,
} |
| {
element -> two,
position -> 2,
} |
| {
element -> three,
position -> 3,
} |
| {
element -> null,
position -> null,
} |
| {
element -> four,
position -> 1,
} |
| {
element -> five,
position -> 2,
} |
| {
element -> null,
position -> null,
} |