pub trait PhysicalOperator: Send {
// Required methods
fn row_schema(&self) -> &RowSchema;
fn open(&mut self) -> ExecResult<()>;
fn next(&mut self) -> ExecResult<Option<Batch>>;
fn close(&mut self) -> ExecResult<()>;
// Provided methods
fn schema(&self) -> &[String] { ... }
fn estimated_cardinality(&self) -> Option<u64> { ... }
fn output_ordering(&self) -> &[PhysicalOrder] { ... }
fn consume_into_aggregate(
&mut self,
_executor: &mut dyn AggregateExecutor,
) -> ExecResult<bool> { ... }
}Expand description
Volcano-style streaming operator. Operators form a tree; each
operator pulls from its children inside next and emits a
Batch until the input is exhausted.
Pipeline lifecycle:
open– bind state, open child operators, allocate buffers.next– pull the nextBatch; returnNoneto terminate.close– release buffers and close child operators.
Blocking operators (sort / hash-aggregate) materialise their input
during open; pipelined operators (filter / project / limit) emit
batches as they arrive.
Required Methods§
Sourcefn row_schema(&self) -> &RowSchema
fn row_schema(&self) -> &RowSchema
Complete logical-to-physical row layout emitted by this operator. Every Batch returned by Self::next must carry this exact schema; operators must reject a child that violates that invariant.
fn open(&mut self) -> ExecResult<()>
fn next(&mut self) -> ExecResult<Option<Batch>>
fn close(&mut self) -> ExecResult<()>
Provided Methods§
Sourcefn estimated_cardinality(&self) -> Option<u64>
fn estimated_cardinality(&self) -> Option<u64>
Planner/runtime cardinality estimate for choosing physical strategies.
None means the operator cannot provide a useful estimate. The value
is advisory rather than a correctness bound.
Sourcefn output_ordering(&self) -> &[PhysicalOrder]
fn output_ordering(&self) -> &[PhysicalOrder]
Leading output ordering known to be preserved by this operator.
Sourcefn consume_into_aggregate(
&mut self,
_executor: &mut dyn AggregateExecutor,
) -> ExecResult<bool>
fn consume_into_aggregate( &mut self, _executor: &mut dyn AggregateExecutor, ) -> ExecResult<bool>
Let a leaf consume its native projected rows directly into an
aggregate executor. Returning false promises that no input was
consumed, so the caller can fall back to ordinary Batch pulls.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".