pub struct WindowContext { /* private fields */ }
Expand description
Context for evaluating window functions
Implementations§
Source§impl WindowContext
impl WindowContext
Sourcepub fn new(
view: Arc<DataView>,
partition_by: Vec<String>,
order_by: Vec<OrderByColumn>,
) -> Result<Self>
pub fn new( view: Arc<DataView>, partition_by: Vec<String>, order_by: Vec<OrderByColumn>, ) -> Result<Self>
Create a new window context with partitioning and ordering
Sourcepub fn get_offset_value(
&self,
current_row: usize,
offset: i32,
column: &str,
) -> Option<DataValue>
pub fn get_offset_value( &self, current_row: usize, offset: i32, column: &str, ) -> Option<DataValue>
Get value at offset from current row (for LAG/LEAD)
Sourcepub fn get_row_number(&self, row_index: usize) -> usize
pub fn get_row_number(&self, row_index: usize) -> usize
Get row number within partition (1-based)
Sourcepub fn get_first_value(
&self,
row_index: usize,
column: &str,
) -> Option<DataValue>
pub fn get_first_value( &self, row_index: usize, column: &str, ) -> Option<DataValue>
Get first value in partition
Sourcepub fn get_last_value(
&self,
row_index: usize,
column: &str,
) -> Option<DataValue>
pub fn get_last_value( &self, row_index: usize, column: &str, ) -> Option<DataValue>
Get last value in partition
Sourcepub fn partition_count(&self) -> usize
pub fn partition_count(&self) -> usize
Get the number of partitions
Sourcepub fn has_partitions(&self) -> bool
pub fn has_partitions(&self) -> bool
Check if context has partitions (vs single window)
Auto Trait Implementations§
impl Freeze for WindowContext
impl !RefUnwindSafe for WindowContext
impl Send for WindowContext
impl Sync for WindowContext
impl Unpin for WindowContext
impl !UnwindSafe for WindowContext
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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