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.Flag
Nested 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_OPERAND
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
Constructor Summary
ConstructorDescriptionDrillCalciteSqlBetweenOperatorWrapper
(org.apache.calcite.sql.fun.SqlBetweenOperator sqlBetweenOperator) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.org.apache.calcite.sql.SqlOperator
Get the wrappedSqlOperator
Methods inherited from class org.apache.calcite.sql.fun.SqlBetweenOperator
getName, getSignatureTemplate, inferReturnType, isNegated, not, reduceExpr, unparse, validRexOperands
Methods inherited from class org.apache.calcite.sql.SqlSpecialOperator
getSyntax
Methods 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:DrillCalciteSqlWrapper
Get the wrappedSqlOperator
- Specified by:
getOperator
in 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:
checkOperandTypes
in classorg.apache.calcite.sql.SqlOperator
-