ArrayReduceRule

Trait ArrayReduceRule 

Source
pub trait ArrayReduceRule<M: Matcher>:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn matcher(&self) -> M;
    fn reduce(&self, array: M::View<'_>) -> VortexResult<Option<ArrayRef>>;
}
Expand description

A rewrite rule that transforms arrays based on the array itself and its children

Required Methods§

Source

fn matcher(&self) -> M

Returns the matcher for this rule

Source

fn reduce(&self, array: M::View<'_>) -> VortexResult<Option<ArrayRef>>

Attempt to rewrite this array.

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§