Trait ArrowPredicate

Source
pub trait ArrowPredicate: Send + 'static {
    // Required methods
    fn projection(&self) -> &ProjectionMask;
    fn evaluate(
        &mut self,
        batch: RecordBatch,
    ) -> Result<BooleanArray, ArrowError>;
}
Expand description

A predicate operating on [RecordBatch]

See also:

  • RowFilter for more information on applying filters during the Parquet decoding process.
  • ArrowPredicateFn for a concrete implementation based on a function

Required Methods§

Source

fn projection(&self) -> &ProjectionMask

Returns the ProjectionMask that describes the columns required to evaluate this predicate.

All projected columns will be provided in the batch passed to evaluate. The projection mask should be as small as possible because any columns needed for the overall projection mask are decoded again after a predicate is applied.

Source

fn evaluate(&mut self, batch: RecordBatch) -> Result<BooleanArray, ArrowError>

Evaluate this predicate for the given [RecordBatch] containing the columns identified by Self::projection

Must return a [BooleanArray] that has the same length as the input batch where each row indicates whether the row should be returned:

  • true:the row should be returned
  • false or null: the row should not be returned

Implementors§

Source§

impl<F> ArrowPredicate for ArrowPredicateFn<F>
where F: FnMut(RecordBatch) -> Result<BooleanArray, ArrowError> + Send + 'static,