@Internal public final class TypeStrategies extends Object
TypeStrategy
Modifier and Type | Field and Description |
---|---|
static TypeStrategy |
COMMON
Type strategy that returns a common, least restrictive type of all arguments.
|
static TypeStrategy |
MISSING
Placeholder for a missing type strategy.
|
Modifier and Type | Method and Description |
---|---|
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.
|
static TypeStrategy |
argument(int pos)
Type strategy that returns the n-th input argument.
|
static TypeStrategy |
argument(int pos,
Function<DataType,Optional<DataType>> mapper)
Type strategy that returns the n-th input argument, mapping it.
|
static TypeStrategy |
explicit(DataType dataType)
Type strategy that returns a fixed
DataType . |
static TypeStrategy |
first(TypeStrategy... strategies)
Type strategy that returns the first type that could be inferred.
|
static TypeStrategy |
forceNullable(TypeStrategy initialStrategy)
Type strategy which forces the given to be nullable.
|
static TypeStrategy |
mapping(Map<InputTypeStrategy,TypeStrategy> mappings)
Type strategy that maps an
InputTypeStrategy to a TypeStrategy if the input
strategy infers identical types. |
static TypeStrategy |
matchFamily(int argumentPos,
LogicalTypeFamily family)
Type strategy that returns the given argument if it is of the same logical type family.
|
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.
|
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.
|
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.
|
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.
|
static TypeStrategy |
varyingString(TypeStrategy initialStrategy)
A type strategy that ensures that the result type is either
LogicalTypeRoot.VARCHAR
or LogicalTypeRoot.VARBINARY from their corresponding non-varying roots. |
public static final TypeStrategy MISSING
public static final TypeStrategy COMMON
public static TypeStrategy explicit(DataType dataType)
DataType
.public static TypeStrategy argument(int pos)
public static TypeStrategy argument(int pos, Function<DataType,Optional<DataType>> mapper)
public static TypeStrategy first(TypeStrategy... strategies)
public static TypeStrategy matchFamily(int argumentPos, LogicalTypeFamily family)
public static TypeStrategy mapping(Map<InputTypeStrategy,TypeStrategy> mappings)
InputTypeStrategy
to a TypeStrategy
if the input
strategy infers identical types.public static TypeStrategy forceNullable(TypeStrategy initialStrategy)
public static TypeStrategy nullableIfArgs(ConstantArgumentCount includedArgs, TypeStrategy initialStrategy)
public static TypeStrategy nullableIfArgs(TypeStrategy initialStrategy)
public static TypeStrategy nullableIfAllArgs(ConstantArgumentCount includedArgs, TypeStrategy initialStrategy)
public static TypeStrategy nullableIfAllArgs(TypeStrategy initialStrategy)
public static TypeStrategy varyingString(TypeStrategy initialStrategy)
LogicalTypeRoot.VARCHAR
or LogicalTypeRoot.VARBINARY
from their corresponding non-varying roots.public static TypeStrategy aggArg0(Function<LogicalType,LogicalType> aggType, boolean nullableIfGroupingEmpty)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.