datafusion_functions_window::lead_lag

Function lag

Source
pub fn lag(
    arg: Expr,
    shift_offset: Option<i64>,
    default_value: Option<ScalarValue>,
) -> Expr
Expand description

Create an expression to represent the lag window function

returns value evaluated at the row that is offset rows before the current row within the partition; if there is no such row, instead return default (which must be of the same type as value). Both offset and default are evaluated with respect to the current row. If omitted, offset defaults to 1 and default to null