Struct datafusion::physical_plan::windows::AggregateWindowExpr
source · pub struct AggregateWindowExpr { /* private fields */ }
Expand description
A window expr that takes the form of an aggregate function
Implementations§
source§impl AggregateWindowExpr
impl AggregateWindowExpr
sourcepub fn new(
aggregate: Arc<dyn AggregateExpr + 'static>,
partition_by: &[Arc<dyn PhysicalExpr + 'static>],
order_by: &[PhysicalSortExpr],
window_frame: Arc<WindowFrame>
) -> AggregateWindowExpr
pub fn new(
aggregate: Arc<dyn AggregateExpr + 'static>,
partition_by: &[Arc<dyn PhysicalExpr + 'static>],
order_by: &[PhysicalSortExpr],
window_frame: Arc<WindowFrame>
) -> AggregateWindowExpr
create a new aggregate window function expression
sourcepub fn get_aggregate_expr(&self) -> &Arc<dyn AggregateExpr + 'static>
pub fn get_aggregate_expr(&self) -> &Arc<dyn AggregateExpr + 'static>
Get aggregate expr of AggregateWindowExpr
Trait Implementations§
source§impl Debug for AggregateWindowExpr
impl Debug for AggregateWindowExpr
source§impl WindowExpr for AggregateWindowExpr
impl WindowExpr for AggregateWindowExpr
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.
source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Return a reference to Any that can be used for downcasting
source§fn field(&self) -> Result<Field, DataFusionError>
fn field(&self) -> Result<Field, DataFusionError>
the field of the final result of this window function.
source§fn name(&self) -> &str
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 + 'static>, Global> ⓘ
fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr + 'static>, Global> ⓘ
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<Arc<dyn Array + 'static>, DataFusionError>
fn evaluate(
&self,
batch: &RecordBatch
) -> Result<Arc<dyn Array + 'static>, DataFusionError>
evaluate the window function values against the batch
source§fn partition_by(&self) -> &[Arc<dyn PhysicalExpr + 'static>]
fn partition_by(&self) -> &[Arc<dyn PhysicalExpr + 'static>]
expressions that’s from the window function’s partition by clause, empty if absent
source§fn order_by(&self) -> &[PhysicalSortExpr]
fn order_by(&self) -> &[PhysicalSortExpr]
expressions that’s from the window function’s order by clause, empty if absent
source§fn get_window_frame(&self) -> &Arc<WindowFrame>
fn get_window_frame(&self) -> &Arc<WindowFrame>
Get the window frame of this WindowExpr.
source§fn get_reverse_expr(&self) -> Option<Arc<dyn WindowExpr + 'static>>
fn get_reverse_expr(&self) -> Option<Arc<dyn WindowExpr + 'static>>
Get the reverse expression of this WindowExpr.
source§fn uses_bounded_memory(&self) -> bool
fn uses_bounded_memory(&self) -> bool
Return a flag indicating whether this WindowExpr can run with
bounded memory.
source§fn evaluate_args(
&self,
batch: &RecordBatch
) -> Result<Vec<Arc<dyn Array + 'static>, Global>, DataFusionError>
fn evaluate_args(
&self,
batch: &RecordBatch
) -> Result<Vec<Arc<dyn Array + 'static>, Global>, DataFusionError>
evaluate the window function arguments against the batch and return
array ref, normally the resulting vec is a single element one.
source§fn evaluate_stateful(
&self,
_partition_batches: &IndexMap<Vec<ScalarValue, Global>, PartitionBatchState, RandomState>,
_window_agg_state: &mut IndexMap<Vec<ScalarValue, Global>, WindowState, RandomState>
) -> Result<(), DataFusionError>
fn evaluate_stateful(
&self,
_partition_batches: &IndexMap<Vec<ScalarValue, Global>, PartitionBatchState, RandomState>,
_window_agg_state: &mut IndexMap<Vec<ScalarValue, Global>, WindowState, RandomState>
) -> Result<(), DataFusionError>
evaluate the window function values against the batch
source§fn evaluate_partition_points(
&self,
num_rows: usize,
partition_columns: &[SortColumn]
) -> Result<Vec<Range<usize>, Global>, DataFusionError>
fn evaluate_partition_points(
&self,
num_rows: usize,
partition_columns: &[SortColumn]
) -> Result<Vec<Range<usize>, Global>, DataFusionError>
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.
source§fn order_by_columns(
&self,
batch: &RecordBatch
) -> Result<Vec<SortColumn, Global>, DataFusionError>
fn order_by_columns(
&self,
batch: &RecordBatch
) -> Result<Vec<SortColumn, Global>, DataFusionError>
get order by columns, empty if absent
source§fn sort_columns(
&self,
batch: &RecordBatch
) -> Result<Vec<SortColumn, Global>, DataFusionError>
fn sort_columns(
&self,
batch: &RecordBatch
) -> Result<Vec<SortColumn, Global>, DataFusionError>
get sort columns that can be used for peer evaluation, empty if absent