pub trait Operator:
Debug
+ DynHash
+ 'static {
// Required methods
fn as_any(&self) -> &dyn Any;
fn vtype(&self) -> VType;
fn children(&self) -> &[Rc<dyn Operator>];
fn with_children(&self, children: Vec<Rc<dyn Operator>>) -> Rc<dyn Operator>;
fn bind(&self, ctx: &dyn BindContext) -> VortexResult<Box<dyn Kernel>>;
// Provided methods
fn in_place(&self) -> bool { ... }
fn reduce_children(
&self,
children: &[Rc<dyn Operator>],
) -> Option<Rc<dyn Operator>> { ... }
fn reduce_parent(
&self,
parent: Rc<dyn Operator>,
) -> Option<Rc<dyn Operator>> { ... }
}
Expand description
An operator represents a node in a logical query plan.
Required Methods§
fn as_any(&self) -> &dyn Any
fn with_children(&self, children: Vec<Rc<dyn Operator>>) -> Rc<dyn Operator>
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: &[Rc<dyn Operator>],
) -> Option<Rc<dyn Operator>>
fn reduce_children( &self, children: &[Rc<dyn Operator>], ) -> Option<Rc<dyn Operator>>
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.