is_end_bound_safe

Function is_end_bound_safe 

Source
pub(crate) fn is_end_bound_safe(
    window_frame_ctx: &WindowFrameContext,
    order_bys: &[ArrayRef],
    most_recent_order_bys: Option<&[ArrayRef]>,
    sort_exprs: &[PhysicalSortExpr],
    idx: usize,
) -> Result<bool>
Expand description

Determines whether the end bound calculation for a window frame context is safe, meaning that the end bound stays the same, regardless of future data, based on the current sort expressions and ORDER BY columns. This function delegates work to specific functions for each frame type.

§Parameters

  • window_frame_ctx: The context of the window frame being evaluated.
  • order_bys: A slice of ArrayRef representing the ORDER BY columns.
  • most_recent_order_bys: An optional reference to the most recent ORDER BY columns.
  • sort_exprs: Defines the lexicographical ordering in question.
  • idx: The current index in the window frame.

§Returns

A Result which is Ok(true) if the end bound is safe, Ok(false) otherwise.