Window Functions
Functions for window operations and analytical processing.
window
Window
dataclass
Represents a window specification for SQL window functions.
window
Defines a window specification for SQL window functions.
The window
function specifies how to partition and order the result set
for the associated window function. It is used to define the scope of the rows
that the window function will operate on.
Parameters:
-
partition_by
(str
) βThe column name by which to partition the result set. Rows with the same value in the partition column will be grouped together for the window function.
-
order_by
(str
) βThe column name by which to order the rows within each partition. This determines the sequence in which the window function is applied.
-
desc
(bool
, default:False
) βIf True, the rows will be ordered in descending order. Defaults to False, which orders the rows in ascending order.
Returns:
-
Window
(Window
) βA
Window
object representing the window specification.