pub fn get_best_fitting_window(
window_exprs: &[Arc<dyn WindowExpr>],
input: &Arc<dyn ExecutionPlan>,
physical_partition_keys: &[Arc<dyn PhysicalExpr>],
) -> Result<Option<Arc<dyn ExecutionPlan>>>
Expand description
Constructs the best-fitting windowing operator (a WindowAggExec
or a
BoundedWindowExec
) for the given input
according to the specifications
of window_exprs
and physical_partition_keys
. Here, best-fitting means
not requiring additional sorting and/or partitioning for the given input.
- A return value of
None
represents that there is no way to construct a windowing operator that doesn’t need additional sorting/partitioning for the given input. Existing ordering should be changed to run the given windowing operation. - A
Some(window exec)
value contains the optimal windowing operator (aWindowAggExec
or aBoundedWindowExec
) for the given input.