Array flatten(数组扁平化(Array flatten))¶
Supported in: Batch, Faster, Streaming
Creates a single array from an input nested array by unioning the elements within the first level of nesting.
Expression categories: Array
Declared arguments¶
- Expression: Nested array to flatten.
Expression\>>
Type variable bounds: T accepts AnyType
Output type: Array\
Examples¶
Example 1: Base case¶
Argument values:
- Expression:
array
| array | Output |
|---|---|
| [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] | [ 1, 2, 3, 4, 5, 6 ] |
Example 2: Base case¶
Argument values:
- Expression:
array
| array | Output |
|---|---|
| [ [ [ 1 ], [ 2 ] ], [ [ 3 ], [ 4 ] ] ] | [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] |
Example 3: Null case¶
Argument values:
- Expression:
array
| array | Output |
|---|---|
| null | null |
| [ null, [ 1, 2 ] ] | [ 1, 2 ] |
中文翻译¶
数组扁平化(Array flatten)¶
支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)
通过合并嵌套数组第一层内的元素,从输入的嵌套数组创建单个数组。
表达式类别: 数组(Array)
声明的参数¶
- 表达式(Expression): 需要扁平化的嵌套数组。
表达式\>>
类型变量约束: T 接受任意类型(AnyType)
输出类型: Array\
示例¶
示例 1:基础情况¶
参数值:
- 表达式:
array
| array | 输出(Output) |
|---|---|
| [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] | [ 1, 2, 3, 4, 5, 6 ] |
示例 2:基础情况¶
参数值:
- 表达式:
array
| array | 输出(Output) |
|---|---|
| [ [ [ 1 ], [ 2 ] ], [ [ 3 ], [ 4 ] ] ] | [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] |
示例 3:空值情况¶
参数值:
- 表达式:
array
| array | 输出(Output) |
|---|---|
| null | null |
| [ null, [ 1, 2 ] ] | [ 1, 2 ] |