Class BaseUserDefinedTableMacro

java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlFunction
org.apache.calcite.sql.validate.SqlUserDefinedTableMacro
org.apache.druid.sql.calcite.external.BaseUserDefinedTableMacro
All Implemented Interfaces:
org.apache.calcite.sql.SqlTableFunction
Direct Known Subclasses:
SchemaAwareUserDefinedTableMacro

public class BaseUserDefinedTableMacro extends org.apache.calcite.sql.validate.SqlUserDefinedTableMacro
Druid-specific version of SqlUserDefinedTableMacro which copies & overrides a bunch of code to handle string array arguments. Would be best if Calcite handled such argument: retire this class if we upgrade to a version of Calcite that handles this task.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.apache.calcite.schema.TableMacro
     

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

    kind, MDX_PRECEDENCE, NL
  • Constructor Summary

    Constructors
    Constructor
    Description
    BaseUserDefinedTableMacro(org.apache.calcite.sql.SqlIdentifier opName, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandMetadata operandMetadata, org.apache.calcite.schema.TableMacro tableMacro)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<Object>
    convertArguments(org.apache.calcite.sql.SqlOperatorBinding callBinding, org.apache.calcite.schema.Function function, org.apache.calcite.sql.SqlIdentifier opName, boolean failOnNonLiteral)
    Similar to Calcite method SqlUserDefinedTableMacro.convertArguments(org.apache.calcite.sql.SqlOperatorBinding, org.apache.calcite.schema.Function, org.apache.calcite.sql.SqlIdentifier, boolean), but with array and named parameter handling.
    org.apache.calcite.schema.TranslatableTable
    getTable(org.apache.calcite.sql.SqlOperatorBinding callBinding)
    Copy of Calcite method SqlUserDefinedTableMacro.getTable(org.apache.calcite.sql.SqlOperatorBinding) to add array and named parameter handling.

    Methods inherited from class org.apache.calcite.sql.validate.SqlUserDefinedTableMacro

    getOperandTypeChecker, getParamNames, getRowTypeInference

    Methods inherited from class org.apache.calcite.sql.SqlFunction

    deriveType, getFunctionType, getNameAsId, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, unparse, validateCall, validateQuantifier

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

    acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.calcite.sql.SqlTableFunction

    tableCharacteristic
  • Field Details

    • macro

      protected final org.apache.calcite.schema.TableMacro macro
  • Constructor Details

    • BaseUserDefinedTableMacro

      public BaseUserDefinedTableMacro(org.apache.calcite.sql.SqlIdentifier opName, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandMetadata operandMetadata, org.apache.calcite.schema.TableMacro tableMacro)
  • Method Details

    • getTable

      public org.apache.calcite.schema.TranslatableTable getTable(org.apache.calcite.sql.SqlOperatorBinding callBinding)
      Copy of Calcite method SqlUserDefinedTableMacro.getTable(org.apache.calcite.sql.SqlOperatorBinding) to add array and named parameter handling.
      Overrides:
      getTable in class org.apache.calcite.sql.validate.SqlUserDefinedTableMacro
    • convertArguments

      public static List<Object> convertArguments(org.apache.calcite.sql.SqlOperatorBinding callBinding, org.apache.calcite.schema.Function function, org.apache.calcite.sql.SqlIdentifier opName, boolean failOnNonLiteral)
      Similar to Calcite method SqlUserDefinedTableMacro.convertArguments(org.apache.calcite.sql.SqlOperatorBinding, org.apache.calcite.schema.Function, org.apache.calcite.sql.SqlIdentifier, boolean), but with array and named parameter handling.