Class InbuiltFunctionEvaluator
- java.lang.Object
-
- org.apache.pinot.segment.local.function.InbuiltFunctionEvaluator
-
- All Implemented Interfaces:
FunctionEvaluator
public class InbuiltFunctionEvaluator extends Object implements FunctionEvaluator
Evaluates an expression.This is optimized for evaluating an expression multiple times with different inputs.
Overall idea: parse the expression into an ExecutableNode, where an ExecutableNode can be:
- FunctionNode - executes a function
- ColumnNode - fetches the value of the column from the input GenericRow
- ConstantNode - returns the literal value
-
-
Constructor Summary
Constructors Constructor Description InbuiltFunctionEvaluator(String functionExpression)
-
Method Summary
Modifier and Type Method Description Objectevaluate(Object[] values)Evaluates the function on the given values (same order as the arguments) and returns the result.Objectevaluate(GenericRow row)Evaluate the function on the generic row and return the resultList<String>getArguments()Get the arguments of the function
-
-
-
Constructor Detail
-
InbuiltFunctionEvaluator
public InbuiltFunctionEvaluator(String functionExpression)
-
-
Method Detail
-
getArguments
public List<String> getArguments()
Description copied from interface:FunctionEvaluatorGet the arguments of the function- Specified by:
getArgumentsin interfaceFunctionEvaluator
-
evaluate
public Object evaluate(GenericRow row)
Description copied from interface:FunctionEvaluatorEvaluate the function on the generic row and return the result- Specified by:
evaluatein interfaceFunctionEvaluator
-
evaluate
public Object evaluate(Object[] values)
Description copied from interface:FunctionEvaluatorEvaluates the function on the given values (same order as the arguments) and returns the result.- Specified by:
evaluatein interfaceFunctionEvaluator
-
-