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 函式。

適用於