Skip to main content

AggregateExecutor

Trait AggregateExecutor 

Source
pub trait AggregateExecutor: Send {
    // Required methods
    fn consume(&mut self, batch: Batch) -> ExecResult<()>;
    fn finish(&mut self) -> ExecResult<SpillBuffer>;

    // Provided methods
    fn supports_projected_rows(&self) -> bool { ... }
    fn supports_storage_borrowed_rows(&self) -> bool { ... }
    fn consume_projected_row(
        &mut self,
        _row: &ProjectedRow<'_, '_>,
    ) -> ExecResult<()> { ... }
}
Expand description

Blocking group-by + aggregate. Pulls every row from the child during open, hashes each row by its group key, and folds the aggregates over each group’s row set. Groups are emitted in the order they were first observed.

Required Methods§

Source

fn consume(&mut self, batch: Batch) -> ExecResult<()>

Consume one child batch. Implementations that need a blocking input must enforce their own byte budget here; the physical operator never creates an unbounded intermediate row vector.

Source

fn finish(&mut self) -> ExecResult<SpillBuffer>

Finalize all groups into a byte-bounded, disk-backed output stream. The row-oriented SQL API may materialize that stream at its public API boundary, but physical operators must not create an unbounded result vector first.

Provided Methods§

Source

fn supports_projected_rows(&self) -> bool

Whether this executor can fold a borrowed, positional row without a materialized ResultRow. A source checks this before advancing.

Source

fn supports_storage_borrowed_rows(&self) -> bool

Whether projected-row consumption is guaranteed not to call back into the engine while a storage backend lends its row values. Sources use this stricter capability before invoking an executor under a backend read borrow.

Source

fn consume_projected_row( &mut self, _row: &ProjectedRow<'_, '_>, ) -> ExecResult<()>

Fold one projected row. Implementations advertising support must preserve the same expression and aggregate semantics as Self::consume.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§