Package io.delta.kernel.expressions
Interface PredicateEvaluator
Special interface for evaluating
Predicate
on input batch and return a selection vector
containing one value for each row in input batch indicating whether the row has passed the
predicate or not.
Optionally it takes an existing selection vector along with the input batch for evaluation. Result selection vector is combined with the given existing selection vector and a new selection vector is returned. This mechanism allows running an input batch through several predicate evaluations without rewriting the input batch to remove rows that do not pass the predicate after each predicate evaluation. The new selection should be same or more selective as the existing selection vector. For example if a row is marked as unselected in existing selection vector, then it should remain unselected in the returned selection vector even when the given predicate returns true for the row.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptioneval
(ColumnarBatch inputData, Optional<ColumnVector> existingSelectionVector) Evaluate the predicate on given inputData.
-
Method Details
-
eval
Evaluate the predicate on given inputData. Combine the existing selection vector with the output of the predicate result and return a new selection vector.- Parameters:
inputData
-ColumnarBatch
of data to which the predicate expression refers for input.existingSelectionVector
- Optional existing selection vector. If not empty, it is combined with the predicate result. The caller is also releasing the ownership of `existingSelectionVector` to this callee, and the callee is responsible for closing it.- Returns:
- A
ColumnVector
of boolean type that captures the predicate result for each row together with the existing selection vector.
-