Share via


Functions.Lag 方法

定义

重载

Lag(Column, Int32, Object)

Window 函数:返回当前行前的“offset”行的值;如果当前行之前的“offset”行数小于“偏移量”,则返回 null。 例如,一个的“offset”将返回窗口分区中任意给定点的前一行。

Lag(String, Int32, Object)

Window 函数:返回当前行前的“offset”行的值;如果当前行之前的“offset”行数小于“偏移量”,则返回 null。 例如,一个的“offset”将返回窗口分区中任意给定点的前一行。

Lag(Column, Int32, Object)

Window 函数:返回当前行前的“offset”行的值;如果当前行之前的“offset”行数小于“偏移量”,则返回 null。 例如,一个的“offset”将返回窗口分区中任意给定点的前一行。

public static Microsoft.Spark.Sql.Column Lag (Microsoft.Spark.Sql.Column column, int offset, object defaultValue = default);
static member Lag : Microsoft.Spark.Sql.Column * int * obj -> Microsoft.Spark.Sql.Column
Public Shared Function Lag (column As Column, offset As Integer, Optional defaultValue As Object = Nothing) As Column

参数

column
Column

要应用的列

offset
Int32

与当前行的偏移量

defaultValue
Object

偏移行不存在时的默认值

返回

Column 对象

注解

这等效于 SQL 中的 LAG 函数。

适用于

Lag(String, Int32, Object)

Window 函数:返回当前行前的“offset”行的值;如果当前行之前的“offset”行数小于“偏移量”,则返回 null。 例如,一个的“offset”将返回窗口分区中任意给定点的前一行。

public static Microsoft.Spark.Sql.Column Lag (string columnName, int offset, object defaultValue = default);
static member Lag : string * int * obj -> Microsoft.Spark.Sql.Column
Public Shared Function Lag (columnName As String, offset As Integer, Optional defaultValue As Object = Nothing) As Column

参数

columnName
String

列名称

offset
Int32

与当前行的偏移量

defaultValue
Object

偏移行不存在时的默认值

返回

Column 对象

注解

这等效于 SQL 中的 LAG 函数。

适用于