Skip to main content

Module window

Module window 

Source
Expand description

Window functions for time-series query processing.

Window functions compute values over a sliding window or partition of rows without collapsing the result set (unlike aggregation, which produces fewer rows). Each input row yields exactly one output value.

§Supported functions

FunctionDescription
RowNumberSequential 1-based row number within partition
RankRank with gaps (1224) for ties on the order column
DenseRankRank without gaps (1223) for ties on the order column
Lead(offset, default)Value offset rows ahead (default if out of range)
Lag(offset, default)Value offset rows behind (default if out of range)
DeltaDifference between current and previous value
RatePer-second rate: delta(value) / delta(timestamp)
IRateInstantaneous per-second rate between last two samples
MovingAverage(window)Simple sliding-window mean
CumulativeSumRunning total
IncreaseMonotonic counter increase (resets to 0 on counter wrap)

Enums§

WindowFn
Window function type.

Functions§

apply_window
Apply window functions to a RecordBatch.
window_fn_name
Human-readable function name for column naming.