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

    Constructors
    Constructor
    Description
    DrillCalciteSqlBetweenOperatorWrapper(org.apache.calcite.sql.fun.SqlBetweenOperator sqlBetweenOperator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure)
    Since Calcite has its rule for type compatibility (see SqlTypeUtil.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 wrapped SqlOperator

    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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 wrapped SqlOperator
      Specified by:
      getOperator in interface DrillCalciteSqlWrapper
      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 (see SqlTypeUtil.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 class org.apache.calcite.sql.SqlOperator