pub trait Operator:
Debug
+ DynHash
+ Send
+ Sync
+ 'static {
// Required methods
fn as_any(&self) -> &dyn Any;
fn vtype(&self) -> VType;
fn children(&self) -> &[OperatorRef] ⓘ;
fn with_children(&self, children: Vec<OperatorRef>) -> OperatorRef;
fn bind(&self, ctx: &dyn BindContext) -> VortexResult<Box<dyn Kernel>>;
// Provided methods
fn in_place(&self) -> bool { ... }
fn reduce_children(&self, children: &[OperatorRef]) -> Option<OperatorRef> { ... }
fn reduce_parent(&self, parent: OperatorRef) -> Option<OperatorRef> { ... }
}
Expand description
An operator represents a node in a logical query plan.
Required Methods§
fn as_any(&self) -> &dyn Any
Sourcefn children(&self) -> &[OperatorRef] ⓘ
fn children(&self) -> &[OperatorRef] ⓘ
The children of this operator.
fn with_children(&self, children: Vec<OperatorRef>) -> OperatorRef
Sourcefn bind(&self, ctx: &dyn BindContext) -> VortexResult<Box<dyn Kernel>>
fn bind(&self, ctx: &dyn BindContext) -> VortexResult<Box<dyn Kernel>>
Create a kernel for this operator
Provided Methods§
Sourcefn in_place(&self) -> bool
fn in_place(&self) -> bool
Whether this operator works by mutating its first child in-place.
If true
, the operator is invoked with the first child’s input data passed via the
mutable output view. The node is expected to mutate this data in-place.
Sourcefn reduce_children(&self, children: &[OperatorRef]) -> Option<OperatorRef>
fn reduce_children(&self, children: &[OperatorRef]) -> Option<OperatorRef>
Operator reduction optimization examples:
Step 1 - Initial pipeline: compare(_, 12) <- for(ref=10) <- bitpacked
Step 2 - reduce_children optimization: compare_scalar(12-10=2) <- bitpacked
Step 3 - Final optimized pipeline (reduce_parent): bitpacked -> compare_scalar(2)
The reduction process eliminates the FoR decoding step by adjusting the comparison constant to work directly on encoded values. Given a set of reduced children, try and reduce the current node. If Keep is returned then the children of this node as still updated.
Sourcefn reduce_parent(&self, parent: OperatorRef) -> Option<OperatorRef>
fn reduce_parent(&self, parent: OperatorRef) -> Option<OperatorRef>
Given a reduced parent, try and reduce the current node.
If Replace
is returned then the parent node and this node and replaced by the returned node.