java.lang.Object
org.apache.arrow.gandiva.expression.TreeBuilder
Contains helper functions for constructing expression trees.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TreeNodeInvoke this function to create a node representing an and-clause.static TreeNodemakeBinaryLiteral(byte[] binaryConstant) static ConditionmakeCondition(String function, List<Field> inFields) Short cut to create an expression tree involving a single function, e.g.static ConditionmakeCondition(TreeNode root) Invoke this function to create a condition.static TreeNodemakeDecimalLiteral(String decimalConstant, int precision, int scale) static ExpressionTreemakeExpression(String function, List<Field> inFields, Field resultField) Short cut to create an expression tree involving a single function, e.g.static ExpressionTreemakeExpression(TreeNode root, Field resultField) Invoke this function to create an expression tree.static TreeNodeInvoke this function to create a node representing a field, e.g.static TreeNodemakeFunction(String function, List<TreeNode> children, ArrowType retType) Invoke this function to create a node representing a function.static TreeNodeInvoke this function to create a node representing an if-clause.static TreeNodemakeInExpressionBigInt(TreeNode resultNode, Set<Long> longValues) static TreeNodemakeInExpressionBinary(TreeNode resultNode, Set<byte[]> binaryValues) static TreeNodemakeInExpressionDecimal(TreeNode resultNode, Set<BigDecimal> decimalValues, Integer precision, Integer scale) static TreeNodemakeInExpressionDouble(TreeNode resultNode, Set<Double> doubleValues) static TreeNodemakeInExpressionFloat(TreeNode resultNode, Set<Float> floatValues) static TreeNodemakeInExpressionInt32(TreeNode resultNode, Set<Integer> intValues) static TreeNodemakeInExpressionString(TreeNode resultNode, Set<String> stringValues) static TreeNodemakeLiteral(Boolean booleanConstant) Helper functions to create literal constants.static TreeNodemakeLiteral(Double doubleConstant) static TreeNodemakeLiteral(Float floatConstant) static TreeNodemakeLiteral(Integer integerConstant) static TreeNodemakeLiteral(Long longConstant) static TreeNodecreate a null literal.static TreeNodeInvoke this function to create a node representing an or-clause.static TreeNodemakeStringLiteral(String stringConstant)
-
Method Details
-
makeLiteral
Helper functions to create literal constants. -
makeLiteral
-
makeLiteral
-
makeLiteral
-
makeLiteral
-
makeStringLiteral
-
makeBinaryLiteral
-
makeDecimalLiteral
-
makeNull
create a null literal. -
makeField
Invoke this function to create a node representing a field, e.g. a column name.- Parameters:
field- represents the input argument - includes the name and type of the field- Returns:
- Node representing a field
-
makeFunction
Invoke this function to create a node representing a function.- Parameters:
function- Name of the function, e.g. addchildren- The arguments to the functionretType- The type of the return value of the operator- Returns:
- Node representing a function
-
makeIf
public static TreeNode makeIf(TreeNode condition, TreeNode thenNode, TreeNode elseNode, ArrowType retType) Invoke this function to create a node representing an if-clause.- Parameters:
condition- Node representing the conditionthenNode- Node representing the if-blockelseNode- Node representing the else-blockretType- Return type of the node- Returns:
- Node representing an if-clause
-
makeAnd
Invoke this function to create a node representing an and-clause.- Parameters:
nodes- Nodes in the 'and' clause.- Returns:
- Node representing an and-clause
-
makeOr
Invoke this function to create a node representing an or-clause.- Parameters:
nodes- Nodes in the 'or' clause.- Returns:
- Node representing an or-clause
-
makeExpression
Invoke this function to create an expression tree.- Parameters:
root- is returned by a call to MakeField, MakeFunction, or MakeIfresultField- represents the return value of the expression- Returns:
- ExpressionTree referring to the root of an expression tree
-
makeExpression
public static ExpressionTree makeExpression(String function, List<Field> inFields, Field resultField) Short cut to create an expression tree involving a single function, e.g. a+b+c.- Parameters:
function- Name of the function, e.g. add()inFields- In arguments to the functionresultField- represents the return value of the expression- Returns:
- ExpressionTree referring to the root of an expression tree
-
makeCondition
Invoke this function to create a condition.- Parameters:
root- is returned by a call to MakeField, MakeFunction, MakeIf, ..- Returns:
- condition referring to the root of an expression tree
-
makeCondition
Short cut to create an expression tree involving a single function, e.g. a+b+c.- Parameters:
function- Name of the function, e.g. add()inFields- In arguments to the function- Returns:
- condition referring to the root of an expression tree
-
makeInExpressionInt32
-
makeInExpressionBigInt
-
makeInExpressionDecimal
-
makeInExpressionFloat
-
makeInExpressionDouble
-
makeInExpressionString
-
makeInExpressionBinary
-