datafusion_physical_expr::window

Struct SlidingAggregateWindowExpr

Source
pub struct SlidingAggregateWindowExpr { /* private fields */ }
Expand description

A window expr that takes the form of an aggregate function that can be incrementally computed over sliding windows.

See comments on WindowExpr for more details.

Implementations§

Source§

impl SlidingAggregateWindowExpr

Source

pub fn new( aggregate: Arc<AggregateFunctionExpr>, partition_by: &[Arc<dyn PhysicalExpr>], order_by: LexOrderingRef<'_>, window_frame: Arc<WindowFrame>, ) -> Self

Create a new (sliding) aggregate window function expression.

Source

pub fn get_aggregate_expr(&self) -> &AggregateFunctionExpr

Get the AggregateFunctionExpr of this object.

Trait Implementations§

Source§

impl Debug for SlidingAggregateWindowExpr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl WindowExpr for SlidingAggregateWindowExpr

Incrementally update window function using the fact that batch is pre-sorted given the sort columns and then per partition point.

Evaluates the peer group (e.g. SUM or MAX gives the same results for peers) and concatenate the results.

Source§

fn as_any(&self) -> &dyn Any

Return a reference to Any that can be used for downcasting

Source§

fn field(&self) -> Result<Field>

The field of the final result of this window function.
Source§

fn name(&self) -> &str

Human readable name such as "MIN(c2)" or "RANK()". The default implementation returns placeholder text.
Source§

fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>

Expressions that are passed to the WindowAccumulator. Functions which take a single input argument, such as sum, return a single datafusion_expr::expr::Expr, others (e.g. cov) return many.
Source§

fn evaluate(&self, batch: &RecordBatch) -> Result<ArrayRef>

Evaluate the window function values against the batch
Source§

fn evaluate_stateful( &self, partition_batches: &PartitionBatches, window_agg_state: &mut PartitionWindowAggStates, ) -> Result<()>

Evaluate the window function against the batch. This function facilitates stateful, bounded-memory implementations.
Source§

fn partition_by(&self) -> &[Arc<dyn PhysicalExpr>]

Expressions that’s from the window function’s partition by clause, empty if absent
Source§

fn order_by(&self) -> LexOrderingRef<'_>

Expressions that’s from the window function’s order by clause, empty if absent
Source§

fn get_window_frame(&self) -> &Arc<WindowFrame>

Get the window frame of this WindowExpr.
Source§

fn get_reverse_expr(&self) -> Option<Arc<dyn WindowExpr>>

Get the reverse expression of this WindowExpr.
Source§

fn uses_bounded_memory(&self) -> bool

Return a flag indicating whether this WindowExpr can run with bounded memory.
Source§

fn with_new_expressions( &self, args: Vec<Arc<dyn PhysicalExpr>>, partition_bys: Vec<Arc<dyn PhysicalExpr>>, order_by_exprs: Vec<Arc<dyn PhysicalExpr>>, ) -> Option<Arc<dyn WindowExpr>>

Rewrites WindowExpr, with new expressions given. The argument should be consistent with the return value of the WindowExpr::all_expressions method. Returns Some(Arc<dyn WindowExpr>) if re-write is supported, otherwise returns None.
Source§

fn evaluate_args(&self, batch: &RecordBatch) -> Result<Vec<ArrayRef>>

Evaluate the window function arguments against the batch and return array ref, normally the resulting Vec is a single element one.
Source§

fn order_by_columns(&self, batch: &RecordBatch) -> Result<Vec<SortColumn>>

Get order by columns, empty if absent
Source§

fn all_expressions(&self) -> WindowPhysicalExpressions

Returns all expressions used in the WindowExpr. These expressions are (1) function arguments, (2) partition by expressions, (3) order by expressions.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.