Trait tidb_query_executors::util::aggr_executor::AggregationExecutorImpl[][src]

pub trait AggregationExecutorImpl<Src: BatchExecutor>: Send {
    fn prepare_entities(&mut self, entities: &mut Entities<Src>);
fn process_batch_input(
        &mut self,
        entities: &mut Entities<Src>,
        input_physical_columns: LazyBatchColumnVec,
        input_logical_rows: &[usize]
    ) -> Result<()>;
fn groups_len(&self) -> usize;
fn iterate_available_groups(
        &mut self,
        entities: &mut Entities<Src>,
        src_is_drained: bool,
        iteratee: impl FnMut(&mut Entities<Src>, &[Box<dyn AggrFunctionState>]) -> Result<()>
    ) -> Result<Vec<LazyBatchColumn>>;
fn is_partial_results_ready(&self) -> bool; }

Required methods

fn prepare_entities(&mut self, entities: &mut Entities<Src>)[src]

Accepts entities without any group by columns and modifies them optionally.

Implementors should modify the schema entity when there are group by columns.

This function will be called only once.

fn process_batch_input(
    &mut self,
    entities: &mut Entities<Src>,
    input_physical_columns: LazyBatchColumnVec,
    input_logical_rows: &[usize]
) -> Result<()>
[src]

Processes a set of columns which are emitted from the underlying executor.

Implementors should update the aggregate function states according to the data of these columns.

fn groups_len(&self) -> usize[src]

Returns the current number of groups.

Note that this number can be inaccurate because it is a hint for the capacity of the vector.

fn iterate_available_groups(
    &mut self,
    entities: &mut Entities<Src>,
    src_is_drained: bool,
    iteratee: impl FnMut(&mut Entities<Src>, &[Box<dyn AggrFunctionState>]) -> Result<()>
) -> Result<Vec<LazyBatchColumn>>
[src]

Iterates aggregate function states for each available group.

Implementors should call iteratee for each group with the aggregate function states of that group as the argument.

Implementors may return the content of each group as extra columns in the return value if there are group by columns.

Implementors should not iterate the same group multiple times for the same partial input data.

fn is_partial_results_ready(&self) -> bool[src]

Returns whether we can now output partial aggregate results when the source is not drained.

This method is called only when the source is not drained because aggregate result is always ready if the source is drained and no error occurs.

Loading content...

Implementors

impl<Src: BatchExecutor> AggregationExecutorImpl<Src> for FastHashAggregationImpl[src]

fn is_partial_results_ready(&self) -> bool[src]

Fast hash aggregation can output aggregate results only if the source is drained.

impl<Src: BatchExecutor> AggregationExecutorImpl<Src> for SimpleAggregationImpl[src]

fn is_partial_results_ready(&self) -> bool[src]

Simple aggregation can output aggregate results only if the source is drained.

impl<Src: BatchExecutor> AggregationExecutorImpl<Src> for SlowHashAggregationImpl[src]

fn is_partial_results_ready(&self) -> bool[src]

Slow hash aggregation can output aggregate results only if the source is drained.

impl<Src: BatchExecutor> AggregationExecutorImpl<Src> for BatchStreamAggregationImpl[src]

fn groups_len(&self) -> usize[src]

Note that the partial group is in count.

fn is_partial_results_ready(&self) -> bool[src]

We cannot ensure the last group is complete, so we can output partial results only if group count >= 2.

Loading content...