Arrays zip(数组压缩(Arrays zip))¶
Supported in: Batch, Faster, Streaming
Zips a list of given arrays into a merged array of structs in which the n-th struct contains all n-th values of input arrays.
Expression categories: Array
Declared arguments¶
- Expressions: A list of arrays to zip.
List\>>
Output type: Array\
Examples¶
Example 1: Base case¶
Argument values:
- Expressions: [
first_array,second_array]
| first_array | second_array | Output |
|---|---|---|
| [ 1, 2, 3 ] | [ 4, 5, 6 ] | [ { first_array: 1, second_array: 4, }, { first_array: 2,<... |
Example 2: Null case¶
Argument values:
- Expressions: [
first_array,second_array]
| first_array | second_array | Output |
|---|---|---|
| [ 1, 2, 3 ] | null | [ { first_array: 1, second_array: null, }, { first_array... |
| null | null | [ ] |
| [ ] | [ ] | [ ] |
Example 3: Edge case¶
Description: Longest length array is used.
Argument values:
- Expressions: [
first_array,second_array]
| first_array | second_array | Output |
|---|---|---|
| [ 1, 2, 3 ] | [ 4, 5 ] | [ { first_array: 1, second_array: 4, }, { first_array: 2,<... |
中文翻译¶
数组压缩(Arrays zip)¶
支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)
将给定的数组列表压缩(zip)为一个结构体(struct)合并数组,其中第 n 个结构体包含所有输入数组的第 n 个值。
表达式类别: 数组(Array)
声明参数¶
- 表达式(Expressions): 需要压缩的数组列表。
List\>>
输出类型: Array\
示例¶
示例 1:基础情况¶
参数值:
- 表达式: [
first_array,second_array]
| first_array | second_array | 输出(Output) |
|---|---|---|
| [ 1, 2, 3 ] | [ 4, 5, 6 ] | [ { first_array: 1, second_array: 4, }, { first_array: 2,<... |
示例 2:空值情况¶
参数值:
- 表达式: [
first_array,second_array]
| first_array | second_array | 输出(Output) |
|---|---|---|
| [ 1, 2, 3 ] | null | [ { first_array: 1, second_array: null, }, { first_array... |
| null | null | [ ] |
| [ ] | [ ] | [ ] |
示例 3:边界情况¶
描述: 使用最长长度的数组。
参数值:
- 表达式: [
first_array,second_array]
| first_array | second_array | 输出(Output) |
|---|---|---|
| [ 1, 2, 3 ] | [ 4, 5 ] | [ { first_array: 1, second_array: 4, }, { first_array: 2,<... |