Class DrillCalciteSqlOperatorWrapper

java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.drill.exec.planner.sql.DrillCalciteSqlOperatorWrapper
All Implemented Interfaces:
DrillCalciteSqlWrapper

public class DrillCalciteSqlOperatorWrapper extends org.apache.calcite.sql.SqlOperator implements DrillCalciteSqlWrapper
This class serves as a wrapper class for SqlOperator. 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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final org.apache.calcite.sql.SqlOperator
     

    Fields inherited from class org.apache.calcite.sql.SqlOperator

    kind, MDX_PRECEDENCE, NL
  • Constructor Summary

    Constructors
    Constructor
    Description
    DrillCalciteSqlOperatorWrapper(org.apache.calcite.sql.SqlOperator operator, String rename, List<DrillFuncHolder> functions)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    argumentMustBeScalar(int ordinal)
     
    boolean
    checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure)
     
    org.apache.calcite.sql.SqlCall
    createCall(org.apache.calcite.sql.SqlLiteral functionQualifier, org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlNode... operands)
     
     
    org.apache.calcite.sql.validate.SqlMonotonicity
    getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call)
     
    org.apache.calcite.sql.SqlOperator
    Get the wrapped SqlOperator
    getSignatureTemplate(int operandsCount)
     
    org.apache.calcite.sql.SqlSyntax
     
    org.apache.calcite.rel.type.RelDataType
    inferReturnType(org.apache.calcite.sql.SqlOperatorBinding opBinding)
     
    boolean
     
    boolean
     
    org.apache.calcite.sql.SqlOperator
     
    org.apache.calcite.sql.SqlNode
    rewriteCall(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.SqlCall call)
     
     
    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.SqlOperator

    acceptCall, acceptCall, adjustType, allowsFraming, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, deriveType, equals, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresOrder, requiresOver, rightPrec, unparseListClause, unparseListClause, validateCall, validateOperands

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • operator

      public final org.apache.calcite.sql.SqlOperator operator
  • Constructor Details

    • DrillCalciteSqlOperatorWrapper

      public DrillCalciteSqlOperatorWrapper(org.apache.calcite.sql.SqlOperator operator, String rename, List<DrillFuncHolder> functions)
  • 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
    • getSyntax

      public org.apache.calcite.sql.SqlSyntax getSyntax()
      Specified by:
      getSyntax in class org.apache.calcite.sql.SqlOperator
    • createCall

      public org.apache.calcite.sql.SqlCall createCall(org.apache.calcite.sql.SqlLiteral functionQualifier, org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlNode... operands)
      Overrides:
      createCall in class org.apache.calcite.sql.SqlOperator
    • rewriteCall

      public org.apache.calcite.sql.SqlNode rewriteCall(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.SqlCall call)
      Overrides:
      rewriteCall in class org.apache.calcite.sql.SqlOperator
    • checkOperandTypes

      public boolean checkOperandTypes(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure)
      Overrides:
      checkOperandTypes in class org.apache.calcite.sql.SqlOperator
    • validRexOperands

      public boolean validRexOperands(int count, org.apache.calcite.util.Litmus litmus)
      Overrides:
      validRexOperands in class org.apache.calcite.sql.SqlOperator
    • getSignatureTemplate

      public String getSignatureTemplate(int operandsCount)
      Overrides:
      getSignatureTemplate in class org.apache.calcite.sql.SqlOperator
    • getAllowedSignatures

      public String getAllowedSignatures(String opNameToUse)
      Overrides:
      getAllowedSignatures in class org.apache.calcite.sql.SqlOperator
    • getMonotonicity

      public org.apache.calcite.sql.validate.SqlMonotonicity getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call)
      Overrides:
      getMonotonicity in class org.apache.calcite.sql.SqlOperator
    • isDeterministic

      public boolean isDeterministic()
      Overrides:
      isDeterministic in class org.apache.calcite.sql.SqlOperator
    • requiresDecimalExpansion

      public boolean requiresDecimalExpansion()
      Overrides:
      requiresDecimalExpansion in class org.apache.calcite.sql.SqlOperator
    • argumentMustBeScalar

      public boolean argumentMustBeScalar(int ordinal)
      Overrides:
      argumentMustBeScalar in class org.apache.calcite.sql.SqlOperator
    • toString

      public String toString()
      Overrides:
      toString in class org.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 class org.apache.calcite.sql.SqlOperator
    • inferReturnType

      public org.apache.calcite.rel.type.RelDataType inferReturnType(org.apache.calcite.sql.SqlOperatorBinding opBinding)
      Overrides:
      inferReturnType in class org.apache.calcite.sql.SqlOperator
    • reverse

      public org.apache.calcite.sql.SqlOperator reverse()
      Overrides:
      reverse in class org.apache.calcite.sql.SqlOperator