Module datafusion_physical_plan::windows
source · Expand description
Physical expressions for window functions
Structs§
- Window execution plan
- A window expr that takes the form of a
BuiltInWindowFunctionExpr
. - A window expr that takes the form of an aggregate function.
- Window execution plan
Traits§
- Common trait for window function implementations
Functions§
- Create a physical expression for window function
- Constructs the best-fitting windowing operator (a
WindowAggExec
or aBoundedWindowExec
) for the giveninput
according to the specifications ofwindow_exprs
andphysical_partition_keys
. Here, best-fitting means not requiring additional sorting and/or partitioning for the given input. - This function calculates the indices such that when partition by expressions reordered with the indices resulting expressions define a preset for existing ordering. For instance, if input is ordered by a, b, c and PARTITION BY b, a is used, this vector will be [1, 0]. It means that when we iterate b, a columns with the order [1, 0] resulting vector (a, b) is a preset of the existing ordering (a, b, c).
- Compares physical ordering (output ordering of the
input
operator) withpartitionby_exprs
andorderby_keys
to decide whether existing ordering is sufficient to run the current window operator. - Build field from window function and add it into schema