Class TypeStrategies
java.lang.Object
org.apache.flink.table.types.inference.TypeStrategies
Strategies for inferring an output or accumulator data type of a function call.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeStrategyType strategy that returns a common, least restrictive type of all arguments.static final TypeStrategyPlaceholder for a missing type strategy. -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeStrategyaggArg0(Function<LogicalType, LogicalType> aggType, boolean nullableIfGroupingEmpty) Type strategy specific for aggregations that partially produce different nullability depending whether the result is grouped or not.static TypeStrategyargument(int pos) Type strategy that returns the n-th input argument.static TypeStrategyType strategy that returns the n-th input argument, mapping it.static TypeStrategycommonRange(ArgumentCount argumentRange) Type strategy that returns a common, least restrictive type of selected arguments.static TypeStrategyType strategy that returns a fixedDataType.static TypeStrategyfirst(TypeStrategy... strategies) Type strategy that returns the first type that could be inferred.static TypeStrategyforceNullable(TypeStrategy initialStrategy) Type strategy which forces the given to be nullable.static TypeStrategymapping(Map<InputTypeStrategy, TypeStrategy> mappings) Type strategy that maps anInputTypeStrategyto aTypeStrategyif the input strategy infers identical types.static TypeStrategymatchFamily(int argumentPos, LogicalTypeFamily family) Type strategy that returns the given argument if it is of the same logical type family.static TypeStrategynullableIfAllArgs(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.static TypeStrategynullableIfAllArgs(TypeStrategy initialStrategy) A type strategy that can be used to make a result type nullable if all the input arguments is nullable.static TypeStrategynullableIfArgs(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.static TypeStrategynullableIfArgs(TypeStrategy initialStrategy) A type strategy that can be used to make a result type nullable if any of the input arguments is nullable.static TypeStrategyvaryingString(TypeStrategy initialStrategy) A type strategy that ensures that the result type is eitherLogicalTypeRoot.VARCHARorLogicalTypeRoot.VARBINARYfrom their corresponding non-varying roots.
-
Field Details
-
MISSING
Placeholder for a missing type strategy. -
COMMON
Type strategy that returns a common, least restrictive type of all arguments.
-
-
Method Details
-
commonRange
Type strategy that returns a common, least restrictive type of selected arguments. -
explicit
Type strategy that returns a fixedDataType. -
argument
Type strategy that returns the n-th input argument. -
argument
Type strategy that returns the n-th input argument, mapping it. -
first
Type strategy that returns the first type that could be inferred. -
matchFamily
Type strategy that returns the given argument if it is of the same logical type family. -
mapping
Type strategy that maps anInputTypeStrategyto aTypeStrategyif the input strategy infers identical types. -
forceNullable
Type strategy which forces the given 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
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
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. -
varyingString
A type strategy that ensures that the result type is eitherLogicalTypeRoot.VARCHARorLogicalTypeRoot.VARBINARYfrom their corresponding non-varying roots. -
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.
-