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§
Sourcefn projection(&self) -> &ProjectionMask
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.
Sourcefn evaluate(&mut self, batch: RecordBatch) -> Result<BooleanArray, ArrowError>
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 returnedfalse
ornull
: the row should not be returned