ArrayParentReduceRule

Trait ArrayParentReduceRule 

Source
pub trait ArrayParentReduceRule<Child: Matcher, Parent: Matcher>:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn child(&self) -> Child;
    fn parent(&self) -> Parent;
    fn reduce_parent(
        &self,
        child: Child::View<'_>,
        parent: Parent::View<'_>,
        child_idx: usize,
    ) -> VortexResult<Option<ArrayRef>>;
}
Expand description

A rewrite rule that transforms arrays based on parent context

Required Methods§

Source

fn child(&self) -> Child

Returns the matcher for the child array

Source

fn parent(&self) -> Parent

Returns the matcher for the parent array

Source

fn reduce_parent( &self, child: Child::View<'_>, parent: Parent::View<'_>, child_idx: usize, ) -> VortexResult<Option<ArrayRef>>

Attempt to rewrite this child array given information about its parent.

Returns:

  • Ok(Some(new_array)) if the rule applied successfully
  • Ok(None) if the rule doesn’t apply
  • Err(e) if an error occurred

Implementors§