Package org.apache.drill.exec.resolver
Class TypeCastRules
java.lang.Object
org.apache.drill.exec.resolver.TypeCastRules
-
Constructor Summary
Constructors -
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 floatgetCost(List<TypeProtos.MajorType> argumentTypes, DrillFuncHolder holder) Decide whether it's legal to do implicit cast.static TypeProtos.DataModegetLeastRestrictiveDataMode(TypeProtos.DataMode... dataModes) static TypeProtos.MinorTypegetLeastRestrictiveType(TypeProtos.MinorType... types) static booleanstatic booleanisCastableWithNullHandling(TypeProtos.MajorType argumentType, TypeProtos.MajorType paramType, FunctionTemplate.NullHandling nullHandling) static booleanisNumericType(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
-