Class DrillCalciteSqlBetweenOperatorWrapper
java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlSpecialOperator
org.apache.calcite.sql.SqlInfixOperator
org.apache.calcite.sql.fun.SqlBetweenOperator
org.apache.drill.exec.planner.sql.DrillCalciteSqlBetweenOperatorWrapper
- All Implemented Interfaces:
DrillCalciteSqlWrapper
public class DrillCalciteSqlBetweenOperatorWrapper
extends org.apache.calcite.sql.fun.SqlBetweenOperator
implements DrillCalciteSqlWrapper
This class serves as a wrapper class for SqlBetweenOperator. 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 SqlOperator.
Note that SqlBetweenOperator cannot be wrapped in
DrillCalciteSqlOperatorWrapper. The reason is when RexNode
conversion is happening, StandardConvertletTable.convertBetween expects the SqlOperator to be a subclass of SqlBetweenOperator.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.sql.fun.SqlBetweenOperator
org.apache.calcite.sql.fun.SqlBetweenOperator.FlagNested classes/interfaces inherited from class org.apache.calcite.sql.SqlSpecialOperator
org.apache.calcite.sql.SqlSpecialOperator.ReduceResult, org.apache.calcite.sql.SqlSpecialOperator.TokenSequence -
Field Summary
Fields inherited from class org.apache.calcite.sql.fun.SqlBetweenOperator
flag, LOWER_OPERAND, UPPER_OPERAND, VALUE_OPERANDFields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL -
Constructor Summary
ConstructorsConstructorDescriptionDrillCalciteSqlBetweenOperatorWrapper(org.apache.calcite.sql.fun.SqlBetweenOperator sqlBetweenOperator) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure) Since Calcite has its rule for type compatibility (seeSqlTypeUtil.isComparable(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType)), which is usually different from Drill's, this method is overridden here to avoid Calcite early terminating the queries.org.apache.calcite.sql.SqlOperatorGet the wrappedSqlOperatorMethods inherited from class org.apache.calcite.sql.fun.SqlBetweenOperator
getName, getSignatureTemplate, inferReturnType, isNegated, not, reduceExpr, unparse, validRexOperandsMethods inherited from class org.apache.calcite.sql.SqlSpecialOperator
getSyntaxMethods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands
-
Constructor Details
-
DrillCalciteSqlBetweenOperatorWrapper
public DrillCalciteSqlBetweenOperatorWrapper(org.apache.calcite.sql.fun.SqlBetweenOperator sqlBetweenOperator)
-
-
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
-
checkOperandTypes
public boolean checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure) Since Calcite has its rule for type compatibility (seeSqlTypeUtil.isComparable(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType)), which is usually different from Drill's, this method is overridden here to avoid Calcite early terminating the queries.- Overrides:
checkOperandTypesin classorg.apache.calcite.sql.SqlOperator
-