Operator

Trait Operator 

Source
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§

Source

fn as_any(&self) -> &dyn Any

Source

fn vtype(&self) -> VType

The output VType of this operator.

Source

fn children(&self) -> &[Rc<dyn Operator>]

The children of this operator.

Source

fn with_children(&self, children: Vec<Rc<dyn Operator>>) -> Rc<dyn Operator>

Source

fn bind(&self, ctx: &dyn BindContext) -> VortexResult<Box<dyn Kernel>>

Create a kernel for this operator

Provided Methods§

Source

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.

Source

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.

Source

fn reduce_parent(&self, parent: Rc<dyn Operator>) -> Option<Rc<dyn Operator>>

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.

Trait Implementations§

Source§

impl<'hash> Hash for dyn Operator + 'hash

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
Source§

impl<'hash> Hash for dyn Operator + Send + 'hash

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
Source§

impl<'hash> Hash for dyn Operator + Send + Sync + 'hash

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
Source§

impl<'hash> Hash for dyn Operator + Sync + 'hash

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more

Implementors§