java.lang.Object
org.apache.arrow.gandiva.evaluator.Filter
This class provides a mechanism to filter a RecordBatch by evaluating a condition expression.
Follow these steps to use this class: 1) Use the static method make() to create an instance of
this class that evaluates a condition. 2) Invoke the method evaluate() to evaluate the filter
against a RecordBatch 3) Invoke close() to release resources
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the LLVM module representing this filter.voidevaluate(int numRows, List<ArrowBuf> buffers, SelectionVector selectionVector) Invoke this function to evaluate filter against a set of arrow buffers.voidevaluate(ArrowRecordBatch recordBatch, SelectionVector selectionVector) Invoke this function to evaluate a filter against a recordBatch.static FilterInvoke this function to generate LLVM code to evaluate the condition expression.static FilterDeprecated.static FilterInvoke this function to generate LLVM code to evaluate the condition expression.static Filtermake(Schema schema, Condition condition, ConfigurationBuilder.ConfigOptions configOptions) Invoke this function to generate LLVM code to evaluate the condition expression.
-
Method Details
-
make
Invoke this function to generate LLVM code to evaluate the condition expression. Invoke Filter::Evaluate() against a RecordBatch to evaluate the filter on this record batch- Parameters:
schema- Table schema. The field names in the schema should match the fields used to create the TreeNodescondition- condition to be evaluated against data- Returns:
- A native filter object that can be used to invoke on a RecordBatch
- Throws:
GandivaException
-
make
public static Filter make(Schema schema, Condition condition, ConfigurationBuilder.ConfigOptions configOptions) throws GandivaException Invoke this function to generate LLVM code to evaluate the condition expression. Invoke Filter::Evaluate() against a RecordBatch to evaluate the filter on this record batch- Parameters:
schema- Table schema. The field names in the schema should match the fields used to create the TreeNodescondition- condition to be evaluated against dataconfigOptions- ConfigOptions parameter- Returns:
- A native filter object that can be used to invoke on a RecordBatch
- Throws:
GandivaException
-
make
@Deprecated public static Filter make(Schema schema, Condition condition, boolean optimize) throws GandivaException Deprecated.Invoke this function to generate LLVM code to evaluate the condition expression. Invoke Filter::Evaluate() against a RecordBatch to evaluate the filter on this record batch- Parameters:
schema- Table schema. The field names in the schema should match the fields used to create the TreeNodescondition- condition to be evaluated against dataoptimize- Flag to choose if the generated llvm code is to be optimized- Returns:
- A native filter object that can be used to invoke on a RecordBatch
- Throws:
GandivaException
-
make
public static Filter make(Schema schema, Condition condition, long configurationId) throws GandivaException Invoke this function to generate LLVM code to evaluate the condition expression. Invoke Filter::Evaluate() against a RecordBatch to evaluate the filter on this record batch- Parameters:
schema- Table schema. The field names in the schema should match the fields used to create the TreeNodescondition- condition to be evaluated against dataconfigurationId- Custom configuration created through config builder.- Returns:
- A native evaluator object that can be used to invoke these projections on a RecordBatch
- Throws:
GandivaException
-
evaluate
public void evaluate(ArrowRecordBatch recordBatch, SelectionVector selectionVector) throws GandivaException Invoke this function to evaluate a filter against a recordBatch.- Parameters:
recordBatch- Record batch including the dataselectionVector- Result of applying the filter on the data- Throws:
GandivaException
-
evaluate
public void evaluate(int numRows, List<ArrowBuf> buffers, SelectionVector selectionVector) throws GandivaException Invoke this function to evaluate filter against a set of arrow buffers. (this is an optimised version that skips taking references).- Parameters:
numRows- number of rows.buffers- List of input arrow buffersselectionVector- Result of applying the filter on the data- Throws:
GandivaException
-
close
Closes the LLVM module representing this filter.- Throws:
GandivaException
-