Class DrillCalciteSqlAggFunctionWrapper
java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlFunction
org.apache.calcite.sql.SqlAggFunction
org.apache.drill.exec.planner.sql.DrillCalciteSqlAggFunctionWrapper
- All Implemented Interfaces:
org.apache.calcite.plan.Context,org.apache.calcite.schema.Wrapper,DrillCalciteSqlWrapper
public class DrillCalciteSqlAggFunctionWrapper
extends org.apache.calcite.sql.SqlAggFunction
implements DrillCalciteSqlWrapper
This class serves as a wrapper class for SqlAggFunction. 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 SqlAggFunction.
-
Field Summary
FieldsFields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL -
Constructor Summary
ConstructorsConstructorDescriptionDrillCalciteSqlAggFunctionWrapper(org.apache.calcite.sql.SqlAggFunction sqlAggFunction, List<DrillFuncHolder> functions) DrillCalciteSqlAggFunctionWrapper(org.apache.calcite.sql.SqlAggFunction sqlAggFunction, org.apache.calcite.rel.type.RelDataType relDataType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanargumentMustBeScalar(int ordinal) booleancheckOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure) org.apache.calcite.rel.type.RelDataTypederiveType(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.SqlMonotonicitygetMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call) org.apache.calcite.sql.SqlOperatorGet the wrappedSqlOperatorgetSignatureTemplate(int operandsCount) org.apache.calcite.sql.SqlSyntaxbooleanbooleanbooleanbooleanbooleanvalidRexOperands(int count, org.apache.calcite.util.Litmus litmus) Methods inherited from class org.apache.calcite.sql.SqlAggFunction
allowsFilter, allowsNullTreatment, getDistinctOptionality, getParameterTypes, getReturnType, getRollup, isPercentile, isQuantifierAllowed, requiresGroupOrder, requiresOrder, requiresOver, unwrap, validateCallMethods inherited from class org.apache.calcite.sql.SqlFunction
getFunctionType, getNameAsId, getParamTypes, getSqlIdentifier, unparse, validateQuantifierMethods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, adjustType, 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, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperandsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
SUM
-
-
Constructor Details
-
DrillCalciteSqlAggFunctionWrapper
public DrillCalciteSqlAggFunctionWrapper(org.apache.calcite.sql.SqlAggFunction sqlAggFunction, List<DrillFuncHolder> functions) -
DrillCalciteSqlAggFunctionWrapper
public DrillCalciteSqlAggFunctionWrapper(org.apache.calcite.sql.SqlAggFunction sqlAggFunction, org.apache.calcite.rel.type.RelDataType relDataType)
-
-
Method Details
-
getOperator
public org.apache.calcite.sql.SqlOperator getOperator()Description copied from interface:DrillCalciteSqlWrapperGet the wrappedSqlOperator- Specified by:
getOperatorin interfaceDrillCalciteSqlWrapper- Returns:
- SqlOperator get the wrapped
SqlOperator
-
validRexOperands
public boolean validRexOperands(int count, org.apache.calcite.util.Litmus litmus) - Overrides:
validRexOperandsin classorg.apache.calcite.sql.SqlOperator
-
getAllowedSignatures
- Overrides:
getAllowedSignaturesin classorg.apache.calcite.sql.SqlOperator
-
isAggregator
public boolean isAggregator()- Overrides:
isAggregatorin classorg.apache.calcite.sql.SqlAggFunction
-
allowsFraming
public boolean allowsFraming()- Overrides:
allowsFramingin classorg.apache.calcite.sql.SqlOperator
-
getMonotonicity
public org.apache.calcite.sql.validate.SqlMonotonicity getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call) - Overrides:
getMonotonicityin classorg.apache.calcite.sql.SqlOperator
-
isDeterministic
public boolean isDeterministic()- Overrides:
isDeterministicin classorg.apache.calcite.sql.SqlOperator
-
isDynamicFunction
public boolean isDynamicFunction()- Overrides:
isDynamicFunctionin classorg.apache.calcite.sql.SqlOperator
-
requiresDecimalExpansion
public boolean requiresDecimalExpansion()- Overrides:
requiresDecimalExpansionin classorg.apache.calcite.sql.SqlOperator
-
argumentMustBeScalar
public boolean argumentMustBeScalar(int ordinal) - Overrides:
argumentMustBeScalarin classorg.apache.calcite.sql.SqlOperator
-
checkOperandTypes
public boolean checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure) - Overrides:
checkOperandTypesin classorg.apache.calcite.sql.SqlOperator
-
getSyntax
public org.apache.calcite.sql.SqlSyntax getSyntax()- Overrides:
getSyntaxin classorg.apache.calcite.sql.SqlFunction
-
getParamNames
- Overrides:
getParamNamesin classorg.apache.calcite.sql.SqlFunction
-
getSignatureTemplate
- Overrides:
getSignatureTemplatein 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:
deriveTypein classorg.apache.calcite.sql.SqlFunction
-