parquet::arrow::arrow_reader::filter

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 RowFilter for more information on the use of this trait.

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

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,