ArrayParentReduceRule

Trait ArrayParentReduceRule 

Source
pub trait ArrayParentReduceRule<V: VTable>:
    Debug
    + Send
    + Sync
    + 'static {
    type Parent: Matcher;

    // Required methods
    fn parent(&self) -> Self::Parent;
    fn reduce_parent(
        &self,
        array: &V::Array,
        parent: <Self::Parent as Matcher>::View<'_>,
        child_idx: usize,
    ) -> VortexResult<Option<ArrayRef>>;
}
Expand description

A rewrite rule that transforms arrays based on parent context

Required Associated Types§

Required Methods§

Source

fn parent(&self) -> Self::Parent

Returns the matcher for the parent array

Source

fn reduce_parent( &self, array: &V::Array, parent: <Self::Parent as Matcher>::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§