public class HiveFunctionHelper extends Object implements FunctionHelper
FunctionHelper.AggregateInfo, FunctionHelper.FieldCollation| Constructor and Description |
|---|
HiveFunctionHelper(org.apache.calcite.rex.RexBuilder rexBuilder) |
| Modifier and Type | Method and Description |
|---|---|
List<org.apache.calcite.rex.RexNode> |
convertInputs(FunctionInfo fi,
List<org.apache.calcite.rex.RexNode> inputs,
org.apache.calcite.rel.type.RelDataType returnType)
Given function information, the inputs to that function, and the
expected return type, it will return the list of inputs with any
necessary adjustments, e.g., casting of expressions.
|
org.apache.calcite.rex.RexNode |
foldExpression(org.apache.calcite.rex.RexNode expr)
Folds expression according to function semantics.
|
FunctionHelper.AggregateInfo |
getAggregateFunctionInfo(boolean isDistinct,
boolean isAllColumns,
String aggregateName,
List<org.apache.calcite.rex.RexNode> aggregateParameters,
List<FunctionHelper.FieldCollation> fieldCollations)
Returns aggregation information based on given parameters.
|
org.apache.calcite.rex.RexNode |
getExpression(String functionText,
FunctionInfo fi,
List<org.apache.calcite.rex.RexNode> inputs,
org.apache.calcite.rel.type.RelDataType returnType)
Given function information and text, inputs to a function, and the
expected return type, it will return an expression node containing
the function call.
|
FunctionInfo |
getFunctionInfo(String functionText)
Returns function information based on function text.
|
org.apache.calcite.rel.type.RelDataType |
getReturnType(FunctionInfo fi,
List<org.apache.calcite.rex.RexNode> inputs)
Given function information and its inputs, it returns
the type of the output of the function.
|
org.apache.calcite.rex.RexCall |
getUDTFFunction(String functionName,
List<org.apache.calcite.rex.RexNode> operands)
Returns RexCall for UDTF from the appropriate function registry based on given parameters
|
FunctionHelper.AggregateInfo |
getWindowAggregateFunctionInfo(boolean isDistinct,
boolean isAllColumns,
String aggregateName,
List<org.apache.calcite.rex.RexNode> aggregateParameters)
Returns aggregation information for analytical function based on given parameters.
|
boolean |
isAndFunction(FunctionInfo fi)
returns true if FunctionInfo is an And function.
|
boolean |
isCompareFunction(FunctionInfo fi)
returns true if FunctionInfo is a compare function (e.g.
|
boolean |
isConsistentWithinQuery(FunctionInfo fi)
Returns whether the expression, for a single query, returns the same result given
the same arguments/children.
|
boolean |
isEqualFunction(FunctionInfo fi)
returns true if FunctionInfo is an == function.
|
boolean |
isInFunction(FunctionInfo fi)
returns true if FunctionInfo is an In function.
|
boolean |
isNSCompareFunction(FunctionInfo fi) |
boolean |
isOrFunction(FunctionInfo fi)
returns true if FunctionInfo is an Or function.
|
boolean |
isStateful(FunctionInfo fi)
returns true if FunctionInfo is a stateful function.
|
public HiveFunctionHelper(org.apache.calcite.rex.RexBuilder rexBuilder)
public FunctionInfo getFunctionInfo(String functionText) throws SemanticException
getFunctionInfo in interface FunctionHelperSemanticExceptionpublic org.apache.calcite.rel.type.RelDataType getReturnType(FunctionInfo fi, List<org.apache.calcite.rex.RexNode> inputs) throws SemanticException
getReturnType in interface FunctionHelperSemanticExceptionpublic List<org.apache.calcite.rex.RexNode> convertInputs(FunctionInfo fi, List<org.apache.calcite.rex.RexNode> inputs, org.apache.calcite.rel.type.RelDataType returnType) throws SemanticException
convertInputs in interface FunctionHelperSemanticExceptionpublic org.apache.calcite.rex.RexNode getExpression(String functionText, FunctionInfo fi, List<org.apache.calcite.rex.RexNode> inputs, org.apache.calcite.rel.type.RelDataType returnType) throws SemanticException
getExpression in interface FunctionHelperSemanticExceptionpublic FunctionHelper.AggregateInfo getAggregateFunctionInfo(boolean isDistinct, boolean isAllColumns, String aggregateName, List<org.apache.calcite.rex.RexNode> aggregateParameters, List<FunctionHelper.FieldCollation> fieldCollations) throws SemanticException
getAggregateFunctionInfo in interface FunctionHelperSemanticExceptionpublic FunctionHelper.AggregateInfo getWindowAggregateFunctionInfo(boolean isDistinct, boolean isAllColumns, String aggregateName, List<org.apache.calcite.rex.RexNode> aggregateParameters) throws SemanticException
getWindowAggregateFunctionInfo in interface FunctionHelperSemanticExceptionpublic org.apache.calcite.rex.RexCall getUDTFFunction(String functionName, List<org.apache.calcite.rex.RexNode> operands) throws SemanticException
FunctionHelpergetUDTFFunction in interface FunctionHelperSemanticExceptionpublic org.apache.calcite.rex.RexNode foldExpression(org.apache.calcite.rex.RexNode expr)
foldExpression in interface FunctionHelperpublic boolean isAndFunction(FunctionInfo fi)
isAndFunction in interface FunctionHelperpublic boolean isOrFunction(FunctionInfo fi)
isOrFunction in interface FunctionHelperpublic boolean isInFunction(FunctionInfo fi)
isInFunction in interface FunctionHelperpublic boolean isCompareFunction(FunctionInfo fi)
isCompareFunction in interface FunctionHelperpublic boolean isEqualFunction(FunctionInfo fi)
isEqualFunction in interface FunctionHelperpublic boolean isNSCompareFunction(FunctionInfo fi)
isNSCompareFunction in interface FunctionHelperpublic boolean isConsistentWithinQuery(FunctionInfo fi)
isConsistentWithinQuery in interface FunctionHelperpublic boolean isStateful(FunctionInfo fi)
isStateful in interface FunctionHelperCopyright © 2024 The Apache Software Foundation. All rights reserved.