Package io.trino.type
Class TypeCoercion
- java.lang.Object
-
- io.trino.type.TypeCoercion
-
public final class TypeCoercion extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTypeCoercion.TypeCompatibility
-
Constructor Summary
Constructors Constructor Description TypeCoercion(Function<TypeSignature,Type> lookupType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCoerce(Type fromType, Type toType)Optional<Type>coerceTypeBase(Type sourceType, String resultTypeBase)coerceTypeBase and isCovariantParametrizedType defines all hand-coded rules for type coercion.Optional<Type>getCommonSuperType(Type firstType, Type secondType)booleanisCompatible(Type fromType, Type toType)static booleanisCovariantTypeBase(String typeBase)booleanisInjectiveCoercion(Type source, Type result)booleanisTypeOnlyCoercion(Type source, Type result)
-
-
-
Constructor Detail
-
TypeCoercion
public TypeCoercion(Function<TypeSignature,Type> lookupType)
-
-
Method Detail
-
coerceTypeBase
public Optional<Type> coerceTypeBase(Type sourceType, String resultTypeBase)
coerceTypeBase and isCovariantParametrizedType defines all hand-coded rules for type coercion. Other methods should reference these two functions instead of hand-code new rules.
-
isCovariantTypeBase
public static boolean isCovariantTypeBase(String typeBase)
-
-