Create struct column(创建结构体列(struct column))¶
Supported in: Batch, Faster, Streaming
Combines multiple columns into a single structured column.
Expression categories: Struct
Declared arguments¶
- Struct elements: List of columns used to create struct.
List\>
Output type: Struct
Examples¶
Example 1: Base case¶
Argument values:
- Struct elements: [
tail_number,id]
| tail_number | id | Output |
|---|---|---|
| MT-112 | 1 | { id: 1, tail_number: MT-112, } |
| XB-123 | 2 | { id: 2, tail_number: XB-123, } |
| PA-654 | 3 | { id: 3, tail_number: PA-654, } |
Example 2: Base case¶
Argument values:
- Struct elements: [
tail_number,id]
| tail_number | id | Output |
|---|---|---|
| null | 1 | { id: 1, tail_number: null, } |
| XB-123 | null | { id: null, tail_number: XB-123, } |
| null | null | { id: null, tail_number: null, } |
中文翻译¶
创建结构体列(struct column)¶
支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)
将多个列合并为一个结构体列(structured column)。
表达式类别: 结构体(Struct)
声明的参数¶
- 结构体元素(Struct elements): 用于创建结构体的列列表。
List\>
输出类型: Struct
示例¶
示例 1:基础案例¶
参数值:
- 结构体元素: [
tail_number,id]
| tail_number | id | 输出 |
|---|---|---|
| MT-112 | 1 | { id: 1, tail_number: MT-112, } |
| XB-123 | 2 | { id: 2, tail_number: XB-123, } |
| PA-654 | 3 | { id: 3, tail_number: PA-654, } |
示例 2:基础案例¶
参数值:
- 结构体元素: [
tail_number,id]
| tail_number | id | 输出 |
|---|---|---|
| null | 1 | { id: 1, tail_number: null, } |
| XB-123 | null | { id: null, tail_number: XB-123, } |
| null | null | { id: null, tail_number: null, } |