row_window_session
Assigns a session window to each row of a serialized row set based on a datetime column. A new session starts when the value is more than max_distance_from_first beyond the session start, or more than max_distance_between_neighbors beyond the previous value; the function returns the session's start datetime. A row set is serialized by the sort, top, top-hitters, or serialize operators; order-preserving operators (extend, project, where, ...) keep that property. Only valid in a serialized context.
Syntax
row_window_session(value, max_distance_from_first, max_distance_between_neighbors, restart)Parameters
Prop
Type
Returns: datetime
Examples
Example 1
datatable(t:datetime)[
datetime(2024-01-01 00:00:00),
datetime(2024-01-01 00:00:30),
datetime(2024-01-01 01:00:00)
]
| sort by t asc
| extend session = row_window_session(t, 1h, 1m)| t (datetime) | session (datetime) |
|---|---|
| 2024-01-01T00:00:00Z | 2024-01-01T00:00:00Z |
| 2024-01-01T00:00:30Z | 2024-01-01T00:00:00Z |
| 2024-01-01T01:00:00Z | 2024-01-01T01:00:00Z |
row_rank_min
Returns the minimum rank of a column in a serialized row set: each row in a run of equal column values gets the 1-based position of the first row in that run, so ranks jump by the run length. An optional restart argument resets the rank when true. A row set is serialized by the sort, top, top-hitters, or serialize operators; order-preserving operators (extend, project, where, ...) keep that property. Only valid in a serialized context.
Introduction to Tabular Operators
Tabular operator overview and categories