Class TypeStrategies


  • @Internal
    public final class TypeStrategies
    extends Object
    Strategies for inferring an output or accumulator data type of a function call.
    See Also:
    TypeStrategy
    • Field Detail

      • MISSING

        public static final TypeStrategy MISSING
        Placeholder for a missing type strategy.
      • COMMON

        public static final TypeStrategy COMMON
        Type strategy that returns a common, least restrictive type of all arguments.
    • Method Detail

      • commonRange

        public static TypeStrategy commonRange​(ArgumentCount argumentRange)
        Type strategy that returns a common, least restrictive type of selected arguments.
      • argument

        public static TypeStrategy argument​(int pos)
        Type strategy that returns the n-th input argument.
      • first

        public static TypeStrategy first​(TypeStrategy... strategies)
        Type strategy that returns the first type that could be inferred.
      • matchFamily

        public static TypeStrategy matchFamily​(int argumentPos,
                                               LogicalTypeFamily family)
        Type strategy that returns the given argument if it is of the same logical type family.
      • forceNullable

        public static TypeStrategy forceNullable​(TypeStrategy initialStrategy)
        Type strategy which forces the given {@param initialStrategy} to be nullable.
      • nullableIfArgs

        public static TypeStrategy nullableIfArgs​(ConstantArgumentCount includedArgs,
                                                  TypeStrategy initialStrategy)
        A type strategy that can be used to make a result type nullable if any of the selected input arguments is nullable. Otherwise the type will be not null.
      • nullableIfArgs

        public static TypeStrategy nullableIfArgs​(TypeStrategy initialStrategy)
        A type strategy that can be used to make a result type nullable if any of the input arguments is nullable. Otherwise the type will be not null.
      • nullableIfAllArgs

        public static TypeStrategy nullableIfAllArgs​(ConstantArgumentCount includedArgs,
                                                     TypeStrategy initialStrategy)
        A type strategy that can be used to make a result type nullable if all the selected input arguments are nullable. Otherwise the type will be non-nullable.
      • nullableIfAllArgs

        public static TypeStrategy nullableIfAllArgs​(TypeStrategy initialStrategy)
        A type strategy that can be used to make a result type nullable if all the input arguments is nullable. Otherwise the type will be not null.
      • aggArg0

        public static TypeStrategy aggArg0​(Function<LogicalType,​LogicalType> aggType,
                                           boolean nullableIfGroupingEmpty)
        Type strategy specific for aggregations that partially produce different nullability depending whether the result is grouped or not.