Class VariantAwareItemOperator


  • public class VariantAwareItemOperator
    extends org.apache.calcite.sql.SqlSpecialOperator
    A variant-aware implementation of the ITEM operator.

    This extends the standard Calcite ITEM operator to support VARIANT type. For ARRAY, MAP, and ROW types, it delegates to the standard Calcite ITEM operator.

    When accessing elements of a VARIANT:

    • VARIANT[INTEGER] - accesses array elements (1-based index)
    • VARIANT[STRING] - accesses object fields by name

    The return type is always VARIANT when the source is VARIANT.

    • Nested Class Summary

      • 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.SqlOperator

        kind, MDX_PRECEDENCE, NL
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean checkOperandTypes​(org.apache.calcite.sql.SqlCallBinding callBinding, boolean throwOnFailure)  
      String getAllowedSignatures​(String opName)  
      org.apache.calcite.sql.SqlOperandCountRange getOperandCountRange()  
      org.apache.calcite.rel.type.RelDataType inferReturnType​(org.apache.calcite.sql.SqlOperatorBinding opBinding)  
      void unparse​(org.apache.calcite.sql.SqlWriter writer, org.apache.calcite.sql.SqlCall call, int leftPrec, int rightPrec)  
      • Methods inherited from class org.apache.calcite.sql.SqlSpecialOperator

        getSyntax, reduceExpr
      • 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, deriveType, equals, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getNameAsId, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getStrongPolicyInference, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands, validRexOperands
    • Constructor Detail

      • VariantAwareItemOperator

        public VariantAwareItemOperator()
    • Method Detail

      • getOperandCountRange

        public org.apache.calcite.sql.SqlOperandCountRange getOperandCountRange()
        Overrides:
        getOperandCountRange 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
      • inferReturnType

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

        public String getAllowedSignatures​(String opName)
        Overrides:
        getAllowedSignatures 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