Package org.apache.drill.exec.resolver
Class TypeCastRules
java.lang.Object
org.apache.drill.exec.resolver.TypeCastRules
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<TypeProtos.MinorType>
getCheapestCast
(TypeProtos.MinorType fromType, TypeProtos.MinorType... toTypes) Finds the type in a given set that has the cheapest cast from a given starting type.static float
getCost
(List<TypeProtos.MajorType> argumentTypes, DrillFuncHolder holder) Decide whether it's legal to do implicit cast.static TypeProtos.DataMode
getLeastRestrictiveDataMode
(TypeProtos.DataMode... dataModes) static TypeProtos.MinorType
getLeastRestrictiveType
(TypeProtos.MinorType... types) static boolean
static boolean
isCastableWithNullHandling
(TypeProtos.MajorType argumentType, TypeProtos.MajorType paramType, FunctionTemplate.NullHandling nullHandling) static boolean
isNumericType
(TypeProtos.MinorType inputType)
-
Constructor Details
-
TypeCastRules
public TypeCastRules()
-
-
Method Details
-
isCastableWithNullHandling
public static boolean isCastableWithNullHandling(TypeProtos.MajorType argumentType, TypeProtos.MajorType paramType, FunctionTemplate.NullHandling nullHandling) -
isCastable
-
getLeastRestrictiveDataMode
-
getLeastRestrictiveType
-
getCheapestCast
public static Optional<TypeProtos.MinorType> getCheapestCast(TypeProtos.MinorType fromType, TypeProtos.MinorType... toTypes) Finds the type in a given set that has the cheapest cast from a given starting type.- Parameters:
fromType
- type to cast from.toTypes
- candidate types to cast to.- Returns:
- the type in toTypes that has the cheapest cast or empty if no finite cost cast can be found.
-
getCost
Decide whether it's legal to do implicit cast. -
isNumericType
-