pub struct WindowFrame {
pub units: WindowFrameUnits,
pub start_bound: WindowFrameBound,
pub end_bound: WindowFrameBound,
/* private fields */
}Expand description
The frame specification determines which output rows are read by an aggregate
window function. The ending frame boundary can be omitted if the BETWEEN
and AND keywords that surround the starting frame boundary are also omitted,
in which case the ending frame boundary defaults to CURRENT ROW.
Fields§
§units: WindowFrameUnitsFrame type - either ROWS, RANGE or GROUPS
start_bound: WindowFrameBoundStarting frame boundary
end_bound: WindowFrameBoundEnding frame boundary
Implementations§
Source§impl WindowFrame
impl WindowFrame
Sourcepub fn new(order_by: Option<bool>) -> Self
pub fn new(order_by: Option<bool>) -> Self
Creates a new, default window frame (with the meaning of default
depending on whether the frame contains an ORDER BY clause and this
ordering is strict (i.e. no ties).
Sourcepub fn reverse(&self) -> Self
pub fn reverse(&self) -> Self
Get reversed window frame. For example
3 ROWS PRECEDING AND 2 ROWS FOLLOWING –>
2 ROWS PRECEDING AND 3 ROWS FOLLOWING
Sourcepub fn new_bounds(
units: WindowFrameUnits,
start_bound: WindowFrameBound,
end_bound: WindowFrameBound,
) -> Self
pub fn new_bounds( units: WindowFrameUnits, start_bound: WindowFrameBound, end_bound: WindowFrameBound, ) -> Self
Initializes window frame from units (type), start bound and end bound.
Sourcepub fn regularize_order_bys(&self, order_by: &mut Vec<Sort>) -> Result<()>
pub fn regularize_order_bys(&self, order_by: &mut Vec<Sort>) -> Result<()>
Regularizes the ORDER BY clause of the window frame.
Sourcepub fn can_accept_multi_orderby(&self) -> bool
pub fn can_accept_multi_orderby(&self) -> bool
Returns whether the window frame can accept multiple ORDER BY expressions.
Sourcepub fn free_range(&self) -> bool
pub fn free_range(&self) -> bool
Returns whether the window frame is “free range”; i.e. its start/end bounds are UNBOUNDED or CURRENT ROW.
This inspects only the bounds, not the frame units, so it returns true
for ROWS and GROUPS frames with such bounds as well. For RANGE frames,
such bounds are located by comparing order key values, whereas a finite
offset bound (e.g. 5 PRECEDING) has to be computed arithmetically from
the current row’s order key value.
Sourcepub fn is_ever_expanding(&self) -> bool
pub fn is_ever_expanding(&self) -> bool
Is the window frame ever-expanding (it always grows in the superset sense). Useful when understanding if set-monotonicity properties of functions can be exploited.
Trait Implementations§
Source§impl Clone for WindowFrame
impl Clone for WindowFrame
Source§impl Debug for WindowFrame
impl Debug for WindowFrame
Source§impl Display for WindowFrame
impl Display for WindowFrame
impl Eq for WindowFrame
Source§impl Hash for WindowFrame
impl Hash for WindowFrame
Source§impl PartialEq for WindowFrame
impl PartialEq for WindowFrame
Source§impl PartialOrd for WindowFrame
impl PartialOrd for WindowFrame
impl StructuralPartialEq for WindowFrame
Source§impl TryFrom<&WindowFrame> for WindowFrame
Available on crate feature proto only.
impl TryFrom<&WindowFrame> for WindowFrame
proto only.Source§impl TryFrom<WindowFrame> for WindowFrame
Available on crate feature proto only.
impl TryFrom<WindowFrame> for WindowFrame
proto only.Source§impl TryFrom<WindowFrame> for WindowFrame
Available on crate feature sql only.
impl TryFrom<WindowFrame> for WindowFrame
sql only.Source§type Error = DataFusionError
type Error = DataFusionError
Source§fn try_from(value: WindowFrame) -> Result<Self>
fn try_from(value: WindowFrame) -> Result<Self>
Auto Trait Implementations§
impl !RefUnwindSafe for WindowFrame
impl !UnwindSafe for WindowFrame
impl Forget for WindowFrame
impl Freeze for WindowFrame
impl Move for WindowFrame
impl Send for WindowFrame
impl Sync for WindowFrame
impl Unpin for WindowFrame
impl UnsafeUnpin for WindowFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more