Class SqlTypeTransforms

java.lang.Object
org.apache.calcite.sql.type.SqlTypeTransforms

public abstract class SqlTypeTransforms extends Object
SqlTypeTransforms defines a number of reusable instances of SqlTypeTransform.

NOTE: avoid anonymous inner classes here except for unique, non-generalizable strategies; anything else belongs in a reusable top-level class. If you find yourself copying and pasting an existing strategy's anonymous inner class, you're making a mistake.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if the type of a call's operand #0 (0-based) is nullable.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type is transformed into the same type but nullable if any of element of a calls operands is nullable.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type is transformed into the same type with nulls allowed.
    static final SqlTypeTransform
    Parameter type-inference transform that transforms MEASURE<T> to T for some type T.
    static final SqlTypeTransform
    Parameter type-inference transform that transforms MEASURE<T> to T for some type T, and does nothing to other types.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that converts a type to a MAP type, which key and value type is same.
    static final SqlTypeTransform
    Type-inference strategy whereby the result is NOT NULL if any of the arguments is NOT NULL; otherwise the type is unchanged.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type must be a struct type with precisely one field and the returned type is the type of that field.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that wraps a given type in an array.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that wraps a given type in a nullabe array.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that wraps a given type in an array, but nullable if any of element of a calls operands is nullable.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that wraps a given type in an array or wraps a field of the given type in an array if the given type is struct with one field.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type must be a multiset or array type and the returned type is element type.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that converts a two-field record type to a MAP type.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that converts a MAP type to a ARRAY type.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that converts a two-field record type to a MAP query type.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that converts a MAP type to a ARRAY type.
    static final SqlTypeTransform
    Parameter type-inference transform that transforms T to MEASURE<T> for some type T.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that wraps a given type in a multiset.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that wraps a given type in a multiset or wraps a field of the given type in a multiset if the given type is struct with one field.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type is transformed into the same type but not nullable.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type is transformed into the same type but nullable if any of a calls operands is nullable.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if all of a call's operands are nullable.
    static final SqlTypeTransform
    Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if the type is a ARRAY type and contains nullable elements.
    static final SqlTypeTransform
    Parameter type-inference transform strategy that converts a MAP type to a two-field record type.
    static final SqlTypeTransform
    Type-inference strategy whereby the result type of a call is VARYING the type given.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TO_NULLABLE

      public static final SqlTypeTransform TO_NULLABLE
      Parameter type-inference transform strategy where a derived type is transformed into the same type but nullable if any of a calls operands is nullable.
    • TO_NULLABLE_IF_ARRAY_CONTAINS_NULLABLE

      public static final SqlTypeTransform TO_NULLABLE_IF_ARRAY_CONTAINS_NULLABLE
      Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if the type is a ARRAY type and contains nullable elements.
    • TO_NULLABLE_ALL

      public static final SqlTypeTransform TO_NULLABLE_ALL
      Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if all of a call's operands are nullable.
    • TO_NOT_NULLABLE

      public static final SqlTypeTransform TO_NOT_NULLABLE
      Parameter type-inference transform strategy where a derived type is transformed into the same type but not nullable.
    • FORCE_NULLABLE

      public static final SqlTypeTransform FORCE_NULLABLE
      Parameter type-inference transform strategy where a derived type is transformed into the same type with nulls allowed.
    • LEAST_NULLABLE

      public static final SqlTypeTransform LEAST_NULLABLE
      Type-inference strategy whereby the result is NOT NULL if any of the arguments is NOT NULL; otherwise the type is unchanged.
    • ARG0_NULLABLE

      public static final SqlTypeTransform ARG0_NULLABLE
      Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if the type of a call's operand #0 (0-based) is nullable.
    • COLLECTION_ELEMENT_TYPE_NULLABLE

      public static final SqlTypeTransform COLLECTION_ELEMENT_TYPE_NULLABLE
      Parameter type-inference transform strategy where a derived type is transformed into the same type but nullable if any of element of a calls operands is nullable.
    • TO_VARYING

      public static final SqlTypeTransform TO_VARYING
      Type-inference strategy whereby the result type of a call is VARYING the type given. The length returned is the same as length of the first argument. Return type will have same nullability as input type nullability. First Arg must be of string type.
    • TO_COLLECTION_ELEMENT_TYPE

      public static final SqlTypeTransform TO_COLLECTION_ELEMENT_TYPE
      Parameter type-inference transform strategy where a derived type must be a multiset or array type and the returned type is element type.
      See Also:
    • TO_MULTISET

      public static final SqlTypeTransform TO_MULTISET
      Parameter type-inference transform strategy that wraps a given type in a multiset.
      See Also:
    • TO_MULTISET_QUERY

      public static final SqlTypeTransform TO_MULTISET_QUERY
      Parameter type-inference transform strategy that wraps a given type in a multiset or wraps a field of the given type in a multiset if the given type is struct with one field. It is used when a multiset input is a sub-query.
    • TO_ARRAY

      public static final SqlTypeTransform TO_ARRAY
      Parameter type-inference transform strategy that wraps a given type in an array.
      See Also:
    • TO_ARRAY_NULLABLE

      public static final SqlTypeTransform TO_ARRAY_NULLABLE
      Parameter type-inference transform strategy that wraps a given type in an array, but nullable if any of element of a calls operands is nullable.
    • TO_ARRAY_FORCE_NULLABLE

      public static final SqlTypeTransform TO_ARRAY_FORCE_NULLABLE
      Parameter type-inference transform strategy that wraps a given type in a nullabe array.
    • TO_MEASURE

      public static final SqlTypeTransform TO_MEASURE
      Parameter type-inference transform that transforms T to MEASURE<T> for some type T.
    • FROM_MEASURE

      public static final SqlTypeTransform FROM_MEASURE
      Parameter type-inference transform that transforms MEASURE<T> to T for some type T. Inverse of TO_MEASURE.
    • FROM_MEASURE_IF

      public static final SqlTypeTransform FROM_MEASURE_IF
      Parameter type-inference transform that transforms MEASURE<T> to T for some type T, and does nothing to other types.
    • TO_ARRAY_QUERY

      public static final SqlTypeTransform TO_ARRAY_QUERY
      Parameter type-inference transform strategy that wraps a given type in an array or wraps a field of the given type in an array if the given type is struct with one field. It is used when an array input is a sub-query.
    • TO_MAP

      public static final SqlTypeTransform TO_MAP
      Parameter type-inference transform strategy that converts a two-field record type to a MAP type.
      See Also:
    • TO_MAP_QUERY

      public static final SqlTypeTransform TO_MAP_QUERY
      Parameter type-inference transform strategy that converts a two-field record type to a MAP query type.
      See Also:
    • IDENTITY_TO_MAP

      public static final SqlTypeTransform IDENTITY_TO_MAP
      Parameter type-inference transform strategy that converts a type to a MAP type, which key and value type is same.
      See Also:
    • TO_ROW

      public static final SqlTypeTransform TO_ROW
      Parameter type-inference transform strategy that converts a MAP type to a two-field record type.
      See Also:
    • TO_MAP_KEYS

      public static final SqlTypeTransform TO_MAP_KEYS
      Parameter type-inference transform strategy that converts a MAP type to a ARRAY type.
      See Also:
    • TO_MAP_VALUES

      public static final SqlTypeTransform TO_MAP_VALUES
      Parameter type-inference transform strategy that converts a MAP type to a ARRAY type.
      See Also:
    • ONLY_COLUMN

      public static final SqlTypeTransform ONLY_COLUMN
      Parameter type-inference transform strategy where a derived type must be a struct type with precisely one field and the returned type is the type of that field.
  • Constructor Details

    • SqlTypeTransforms

      public SqlTypeTransforms()