跳转至

Collect distinct array(收集去重数组(Collect distinct array))

Supported in: Batch, Faster, Streaming

Collects an array of deduplicated values within each group. Null values are ignored.

Expression categories: Aggregate

Declared arguments

  • Expression: The column of values to collect into an array, keeping distinct values only.
    Expression\

Type variable bounds: T accepts ComparableType

Output type: Array\

Examples

Example 1: Base case

Argument values:

  • Expression: factor

Given input table:

factor
2
2
3

Outputs: [ 2, 3 ]


Example 2: Null case

Argument values:

  • Expression: factor

Given input table:

factor
2
null
3

Outputs: [ 2, 3 ]



中文翻译


收集去重数组(Collect distinct array)

支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)

在每个分组内收集去重后的值并组成数组。空值(null)将被忽略。

表达式类别: 聚合(Aggregate)

声明的参数

  • 表达式(Expression): 要收集到数组中的值列,仅保留不重复的值。
    表达式\

类型变量边界: T 接受 ComparableType

输出类型: 数组\

示例

示例 1:基础情况

参数值:

  • 表达式: factor

输入表:

factor
2
2
3

输出结果: [ 2, 3 ]


示例 2:空值情况

参数值:

  • 表达式: factor

输入表:

factor
2
null
3

输出结果: [ 2, 3 ]