跳转至

Last(Last(最后))

Supported in: Batch, Faster, Streaming

Last item in the group. Note, if used within an aggregate or unordered window, the row selected will be non-deterministic.

Expression categories: Aggregate

Declared arguments

  • Expression: Expression to aggregate.
    Expression\
  • Ignore nulls: If true, null values will be ignored.
    Literal\

Type variable bounds: T accepts AnyType

Output type: T

Examples

Example 1: Base case

Argument values:

  • Expression: values
  • Ignore nulls: false

Given input table:

values
2
4
3
null

Outputs: null


Example 2: Base case

Argument values:

  • Expression: values
  • Ignore nulls: true

Given input table:

values
2
4
3
null

Outputs: 3



中文翻译


Last(最后)

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

分组中的最后一项。请注意,如果在聚合(aggregate)或无序窗口(unordered window)中使用,所选的行将是不确定的。

表达式类别: 聚合(Aggregate)

声明的参数

  • 表达式(Expression): 要聚合的表达式。
    Expression\
  • 忽略空值(Ignore nulls): 如果为 true,将忽略空值。
    Literal\

类型变量边界: T 接受 AnyType

输出类型: T

示例

示例 1:基础情况

参数值:

  • 表达式: values
  • 忽略空值: false

给定输入表:

values
2
4
3
null

输出结果: null


示例 2:基础情况

参数值:

  • 表达式: values
  • 忽略空值: true

给定输入表:

values
2
4
3
null

输出结果: 3