Share via


Functions.Lead Method

Definition

Overloads

Lead(String, Int32, Object)

Window function: returns the value that is 'offset' rows after the current row, and null if there is less than 'offset' rows after the current row. For example, an 'offset' of one will return the next row at any given point in the window partition.

Lead(Column, Int32, Object)

Window function: returns the value that is 'offset' rows after the current row, and null if there is less than 'offset' rows after the current row. For example, an 'offset' of one will return the next row at any given point in the window partition.

Lead(String, Int32, Object)

Window function: returns the value that is 'offset' rows after the current row, and null if there is less than 'offset' rows after the current row. For example, an 'offset' of one will return the next row at any given point in the window partition.

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

Parameters

columnName
String

Column name

offset
Int32

Offset from the current row

defaultValue
Object

Default value when the offset row doesn't exist

Returns

Column object

Remarks

This is equivalent to the LEAD function in SQL.

Applies to

Lead(Column, Int32, Object)

Window function: returns the value that is 'offset' rows after the current row, and null if there is less than 'offset' rows after the current row. For example, an 'offset' of one will return the next row at any given point in the window partition.

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

Parameters

column
Column

Column to apply

offset
Int32

Offset from the current row

defaultValue
Object

Default value when the offset row doesn't exist

Returns

Column object

Remarks

This is equivalent to the LEAD function in SQL.

Applies to