Class StandardConvertletTable

  • All Implemented Interfaces:
    org.apache.calcite.sql2rel.SqlRexConvertletTable

    public class StandardConvertletTable
    extends org.apache.calcite.sql2rel.ReflectiveConvertletTable
    Standard implementation of SqlRexConvertletTable.

    Lines 691-736 implement supporting RETURNING clause in JSON_QUERY (CALCITE-6365).

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.calcite.rex.RexNode castToValidatedType​(org.apache.calcite.sql.SqlNode node, org.apache.calcite.rex.RexNode e, org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.rex.RexBuilder rexBuilder)
      Casts a RexNode value to the validated type of a SqlCall.
      org.apache.calcite.rex.RexNode castToValidatedType​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlCall call, org.apache.calcite.rex.RexNode value)
      Casts a RexNode value to the validated type of a SqlCall.
      org.apache.calcite.rex.RexNode convertAggregateFunction​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlAggFunction fun, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertArray​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlArrayValueConstructor op, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertBetween​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlBetweenOperator op, org.apache.calcite.sql.SqlCall call)
      Converts a BETWEEN expression.
      org.apache.calcite.rex.RexNode convertCall​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlCall call)
      Converts a call to an operator into a RexCall to the same operator.
      org.apache.calcite.rex.RexNode convertCase​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlCase call)
      Converts a CASE expression.
      protected org.apache.calcite.rex.RexNode convertCast​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertDatetimeMinus​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlDatetimeSubtractionOperator op, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertExtract​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlExtractFunction op, org.apache.calcite.sql.SqlCall call)
      Converts a call to the EXTRACT function.
      protected org.apache.calcite.rex.RexNode convertFloorCeil​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertFunction​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlFunction fun, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertJdbc​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlJdbcFunctionCall op, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertJsonQueryFunction​(org.apache.calcite.sql2rel.SqlRexContext cx, SqlJsonQueryFunction fun, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertJsonReturningFunction​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlFunction fun, org.apache.calcite.sql.SqlCall call, Predicate<org.apache.calcite.sql.SqlNode[]> hasExplicitTypeSpec, Function<org.apache.calcite.sql.SqlCall,​List<org.apache.calcite.sql.SqlNode>> removeTypeSpecOperands)  
      org.apache.calcite.rex.RexNode convertJsonValueFunction​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlJsonValueFunction fun, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertLiteralChain​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlLiteralChainOperator op, org.apache.calcite.sql.SqlCall call)
      Converts a LiteralChain expression: that is, concatenates the operands immediately, to produce a single literal string.
      org.apache.calcite.rex.RexNode convertMap​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlMapValueConstructor op, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertMultiset​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlMultisetValueConstructor op, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertMultisetQuery​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlMultisetQueryConstructor op, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertOverlaps​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlOverlapsOperator op, org.apache.calcite.sql.SqlCall call)
      Converts a call to OVERLAPS.
      org.apache.calcite.rex.RexNode convertRow​(org.apache.calcite.sql2rel.SqlRexContext cx, SqlRowOperator op, org.apache.calcite.sql.SqlCall call)
      Converts a ROW.
      org.apache.calcite.rex.RexNode convertSequenceValue​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlSequenceValueOperator fun, org.apache.calcite.sql.SqlCall call)  
      org.apache.calcite.rex.RexNode convertSubstring​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.fun.SqlSubstringFunction op, org.apache.calcite.sql.SqlCall call)
      Converts a SUBSTRING expression.
      org.apache.calcite.rex.RexNode convertWindowFunction​(org.apache.calcite.sql2rel.SqlRexContext cx, org.apache.calcite.sql.SqlWindowTableFunction fun, org.apache.calcite.sql.SqlCall call)  
      • Methods inherited from class org.apache.calcite.sql2rel.ReflectiveConvertletTable

        addAlias, get, registerOp
    • Method Detail

      • convertCase

        public org.apache.calcite.rex.RexNode convertCase​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                          org.apache.calcite.sql.fun.SqlCase call)
        Converts a CASE expression.
      • convertMultiset

        public org.apache.calcite.rex.RexNode convertMultiset​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                              org.apache.calcite.sql.fun.SqlMultisetValueConstructor op,
                                                              org.apache.calcite.sql.SqlCall call)
      • convertArray

        public org.apache.calcite.rex.RexNode convertArray​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                           org.apache.calcite.sql.fun.SqlArrayValueConstructor op,
                                                           org.apache.calcite.sql.SqlCall call)
      • convertMap

        public org.apache.calcite.rex.RexNode convertMap​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                         org.apache.calcite.sql.fun.SqlMapValueConstructor op,
                                                         org.apache.calcite.sql.SqlCall call)
      • convertMultisetQuery

        public org.apache.calcite.rex.RexNode convertMultisetQuery​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                   org.apache.calcite.sql.fun.SqlMultisetQueryConstructor op,
                                                                   org.apache.calcite.sql.SqlCall call)
      • convertJdbc

        public org.apache.calcite.rex.RexNode convertJdbc​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                          org.apache.calcite.sql.SqlJdbcFunctionCall op,
                                                          org.apache.calcite.sql.SqlCall call)
      • convertCast

        protected org.apache.calcite.rex.RexNode convertCast​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                             org.apache.calcite.sql.SqlCall call)
      • convertFloorCeil

        protected org.apache.calcite.rex.RexNode convertFloorCeil​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                  org.apache.calcite.sql.SqlCall call)
      • convertExtract

        public org.apache.calcite.rex.RexNode convertExtract​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                             org.apache.calcite.sql.fun.SqlExtractFunction op,
                                                             org.apache.calcite.sql.SqlCall call)
        Converts a call to the EXTRACT function.

        Called automatically via reflection.

      • convertDatetimeMinus

        public org.apache.calcite.rex.RexNode convertDatetimeMinus​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                   org.apache.calcite.sql.fun.SqlDatetimeSubtractionOperator op,
                                                                   org.apache.calcite.sql.SqlCall call)
      • convertFunction

        public org.apache.calcite.rex.RexNode convertFunction​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                              org.apache.calcite.sql.SqlFunction fun,
                                                              org.apache.calcite.sql.SqlCall call)
      • convertWindowFunction

        public org.apache.calcite.rex.RexNode convertWindowFunction​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                    org.apache.calcite.sql.SqlWindowTableFunction fun,
                                                                    org.apache.calcite.sql.SqlCall call)
      • convertJsonValueFunction

        public org.apache.calcite.rex.RexNode convertJsonValueFunction​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                       org.apache.calcite.sql.fun.SqlJsonValueFunction fun,
                                                                       org.apache.calcite.sql.SqlCall call)
      • convertJsonQueryFunction

        public org.apache.calcite.rex.RexNode convertJsonQueryFunction​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                       SqlJsonQueryFunction fun,
                                                                       org.apache.calcite.sql.SqlCall call)
      • convertJsonReturningFunction

        public org.apache.calcite.rex.RexNode convertJsonReturningFunction​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                           org.apache.calcite.sql.SqlFunction fun,
                                                                           org.apache.calcite.sql.SqlCall call,
                                                                           Predicate<org.apache.calcite.sql.SqlNode[]> hasExplicitTypeSpec,
                                                                           Function<org.apache.calcite.sql.SqlCall,​List<org.apache.calcite.sql.SqlNode>> removeTypeSpecOperands)
      • convertSequenceValue

        public org.apache.calcite.rex.RexNode convertSequenceValue​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                   org.apache.calcite.sql.fun.SqlSequenceValueOperator fun,
                                                                   org.apache.calcite.sql.SqlCall call)
      • convertAggregateFunction

        public org.apache.calcite.rex.RexNode convertAggregateFunction​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                       org.apache.calcite.sql.SqlAggFunction fun,
                                                                       org.apache.calcite.sql.SqlCall call)
      • convertCall

        public org.apache.calcite.rex.RexNode convertCall​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                          org.apache.calcite.sql.SqlCall call)
        Converts a call to an operator into a RexCall to the same operator.

        Called automatically via reflection.

        Parameters:
        cx - Context
        call - Call
        Returns:
        Rex call
      • convertBetween

        public org.apache.calcite.rex.RexNode convertBetween​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                             org.apache.calcite.sql.fun.SqlBetweenOperator op,
                                                             org.apache.calcite.sql.SqlCall call)
        Converts a BETWEEN expression.

        Called automatically via reflection.

      • convertSubstring

        public org.apache.calcite.rex.RexNode convertSubstring​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                               org.apache.calcite.sql.fun.SqlSubstringFunction op,
                                                               org.apache.calcite.sql.SqlCall call)
        Converts a SUBSTRING expression.

        Called automatically via reflection.

      • convertLiteralChain

        public org.apache.calcite.rex.RexNode convertLiteralChain​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                  org.apache.calcite.sql.fun.SqlLiteralChainOperator op,
                                                                  org.apache.calcite.sql.SqlCall call)
        Converts a LiteralChain expression: that is, concatenates the operands immediately, to produce a single literal string.

        Called automatically via reflection.

      • convertRow

        public org.apache.calcite.rex.RexNode convertRow​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                         SqlRowOperator op,
                                                         org.apache.calcite.sql.SqlCall call)
        Converts a ROW.

        Called automatically via reflection.

      • convertOverlaps

        public org.apache.calcite.rex.RexNode convertOverlaps​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                              org.apache.calcite.sql.fun.SqlOverlapsOperator op,
                                                              org.apache.calcite.sql.SqlCall call)
        Converts a call to OVERLAPS.

        Called automatically via reflection.

      • castToValidatedType

        public org.apache.calcite.rex.RexNode castToValidatedType​(org.apache.calcite.sql2rel.SqlRexContext cx,
                                                                  org.apache.calcite.sql.SqlCall call,
                                                                  org.apache.calcite.rex.RexNode value)
        Casts a RexNode value to the validated type of a SqlCall. If the value was already of the validated type, then the value is returned without an additional cast.
      • castToValidatedType

        public static org.apache.calcite.rex.RexNode castToValidatedType​(org.apache.calcite.sql.SqlNode node,
                                                                         org.apache.calcite.rex.RexNode e,
                                                                         org.apache.calcite.sql.validate.SqlValidator validator,
                                                                         org.apache.calcite.rex.RexBuilder rexBuilder)
        Casts a RexNode value to the validated type of a SqlCall. If the value was already of the validated type, then the value is returned without an additional cast.