Class DrillCalciteSqlFunctionWrapper
java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlFunction
org.apache.drill.exec.planner.sql.DrillCalciteSqlFunctionWrapper
- All Implemented Interfaces:
DrillCalciteSqlWrapper
public class DrillCalciteSqlFunctionWrapper
extends org.apache.calcite.sql.SqlFunction
implements DrillCalciteSqlWrapper
This class serves as a wrapper class for SqlFunction. The motivation is to plug-in the return type inference and operand
type check algorithms of Drill into Calcite's sql validation procedure.
Except for the methods which are relevant to the return type inference and operand type check algorithms, the wrapper
simply forwards the method calls to the wrapped SqlFunction.
-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
Constructor Summary
ConstructorDescriptionDrillCalciteSqlFunctionWrapper
(org.apache.calcite.sql.SqlFunction wrappedFunction, List<DrillFuncHolder> functions) -
Method Summary
Modifier and TypeMethodDescriptionboolean
argumentMustBeScalar
(int ordinal) boolean
checkOperandTypes
(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure) org.apache.calcite.rel.type.RelDataType
deriveType
(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlCall call) getAllowedSignatures
(String opNameToUse) org.apache.calcite.sql.validate.SqlMonotonicity
getMonotonicity
(org.apache.calcite.sql.SqlOperatorBinding call) org.apache.calcite.sql.SqlOperator
Get the wrappedSqlOperator
getSignatureTemplate
(int operandsCount) org.apache.calcite.sql.SqlSyntax
boolean
boolean
boolean
org.apache.calcite.sql.SqlNode
rewriteCall
(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.SqlCall call) toString()
void
unparse
(org.apache.calcite.sql.SqlWriter writer, org.apache.calcite.sql.SqlCall call, int leftPrec, int rightPrec) boolean
validRexOperands
(int count, org.apache.calcite.util.Litmus litmus) Methods inherited from class org.apache.calcite.sql.SqlFunction
getFunctionType, getNameAsId, getParamTypes, getSqlIdentifier, isQuantifierAllowed, validateCall, validateQuantifier
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, adjustType, allowsFraming, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, equals, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresOrder, requiresOver, reverse, rightPrec, unparseListClause, unparseListClause, validateOperands
-
Constructor Details
-
DrillCalciteSqlFunctionWrapper
public DrillCalciteSqlFunctionWrapper(org.apache.calcite.sql.SqlFunction wrappedFunction, List<DrillFuncHolder> functions)
-
-
Method Details
-
rewriteCall
public org.apache.calcite.sql.SqlNode rewriteCall(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.SqlCall call) - Overrides:
rewriteCall
in classorg.apache.calcite.sql.SqlOperator
-
getOperator
public org.apache.calcite.sql.SqlOperator getOperator()Description copied from interface:DrillCalciteSqlWrapper
Get the wrappedSqlOperator
- Specified by:
getOperator
in interfaceDrillCalciteSqlWrapper
- Returns:
- SqlOperator get the wrapped
SqlOperator
-
validRexOperands
public boolean validRexOperands(int count, org.apache.calcite.util.Litmus litmus) - Overrides:
validRexOperands
in classorg.apache.calcite.sql.SqlOperator
-
getAllowedSignatures
- Overrides:
getAllowedSignatures
in classorg.apache.calcite.sql.SqlOperator
-
getMonotonicity
public org.apache.calcite.sql.validate.SqlMonotonicity getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call) - Overrides:
getMonotonicity
in classorg.apache.calcite.sql.SqlOperator
-
isDeterministic
public boolean isDeterministic()- Overrides:
isDeterministic
in classorg.apache.calcite.sql.SqlOperator
-
isDynamicFunction
public boolean isDynamicFunction()- Overrides:
isDynamicFunction
in classorg.apache.calcite.sql.SqlOperator
-
requiresDecimalExpansion
public boolean requiresDecimalExpansion()- Overrides:
requiresDecimalExpansion
in classorg.apache.calcite.sql.SqlOperator
-
argumentMustBeScalar
public boolean argumentMustBeScalar(int ordinal) - Overrides:
argumentMustBeScalar
in classorg.apache.calcite.sql.SqlOperator
-
checkOperandTypes
public boolean checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure) - Overrides:
checkOperandTypes
in classorg.apache.calcite.sql.SqlOperator
-
getSyntax
public org.apache.calcite.sql.SqlSyntax getSyntax()- Overrides:
getSyntax
in classorg.apache.calcite.sql.SqlFunction
-
getParamNames
- Overrides:
getParamNames
in classorg.apache.calcite.sql.SqlFunction
-
getSignatureTemplate
- Overrides:
getSignatureTemplate
in classorg.apache.calcite.sql.SqlOperator
-
deriveType
public org.apache.calcite.rel.type.RelDataType deriveType(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlCall call) - Overrides:
deriveType
in classorg.apache.calcite.sql.SqlFunction
-
toString
- Overrides:
toString
in classorg.apache.calcite.sql.SqlOperator
-
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, org.apache.calcite.sql.SqlCall call, int leftPrec, int rightPrec) - Overrides:
unparse
in classorg.apache.calcite.sql.SqlFunction
-