pub trait WindowExpr: Send + Sync + Debug {
Show 16 methods fn as_any(&self) -> &dyn Any; fn field(&self) -> Result<Field>; fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>> ; fn evaluate(&self, batch: &RecordBatch) -> Result<ArrayRef>; fn partition_by(&self) -> &[Arc<dyn PhysicalExpr>]; fn order_by(&self) -> &[PhysicalSortExpr]; fn get_window_frame(&self) -> &Arc<WindowFrame>; fn uses_bounded_memory(&self) -> bool; fn get_reverse_expr(&self) -> Option<Arc<dyn WindowExpr>>; fn name(&self) -> &str { ... } fn evaluate_args(&self, batch: &RecordBatch) -> Result<Vec<ArrayRef>> { ... } fn evaluate_stateful(
        &self,
        _partition_batches: &PartitionBatches,
        _window_agg_state: &mut PartitionWindowAggStates
    ) -> Result<()> { ... } fn evaluate_partition_points(
        &self,
        num_rows: usize,
        partition_columns: &[SortColumn]
    ) -> Result<Vec<Range<usize>>> { ... } fn order_by_columns(&self, batch: &RecordBatch) -> Result<Vec<SortColumn>> { ... } fn sort_columns(&self, batch: &RecordBatch) -> Result<Vec<SortColumn>> { ... } fn get_values_orderbys(
        &self,
        record_batch: &RecordBatch
    ) -> Result<(Vec<ArrayRef>, Vec<ArrayRef>)> { ... }
}
Expand description

A window expression that:

  • knows its resulting field

Required Methods§

Returns the window expression as Any so that it can be downcast to a specific implementation.

the field of the final result of this window function.

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.

evaluate the window function values against the batch

expressions that’s from the window function’s partition by clause, empty if absent

expressions that’s from the window function’s order by clause, empty if absent

Get the window frame of this WindowExpr.

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

Get the reverse expression of this WindowExpr.

Provided Methods§

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

evaluate the window function arguments against the batch and return array ref, normally the resulting vec is a single element one.

evaluate the window function values against the batch

evaluate the partition points given the sort columns; if the sort columns are empty then the result will be a single element vec of the whole column rows.

get order by columns, empty if absent

get sort columns that can be used for peer evaluation, empty if absent

Get values columns(argument of Window Function) and order by columns (columns of the ORDER BY expression)used in evaluators

Implementors§

peer based evaluation based on the fact that batch is pre-sorted given the sort columns and then per partition point we’ll evaluate the peer group (e.g. SUM or MAX gives the same results for peers) and concatenate the results.

peer based evaluation based on the fact that batch is pre-sorted given the sort columns and then per partition point we’ll evaluate the peer group (e.g. SUM or MAX gives the same results for peers) and concatenate the results.