Changes numeric values to booleans so that expressions like true = 1 can be evaluated.
Coerces the type of different branches of a CASE WHEN statement to a common type.
Turns Add/Subtract of DateType/TimestampType/StringType and CalendarIntervalType to TimeAdd/TimeSub
Calculates and propagates precision for fixed-precision decimals.
Hive only performs integral division with the DIV operator.
This ensure that the types for various functions are as expected.
Coerces the type of different branches of If statement to a common type.
Casts types according to the expected input types for Expressions.
Convert the value and in list expressions to the common operator type by looking at all the argument types and finding the closest one that all the arguments can be cast to.
Promotes strings that appear in arithmetic expressions.
Applies any changes to AttributeReference data types that are made by other rules to instances higher in the query tree.
When encountering a cast from a string representing a valid fractional number to an integral
type the jvm will throw a java.lang.NumberFormatException
.
Widens numeric types and converts strings to numbers when appropriate.
Find the tightest common type of two types that might be used in a binary expression.
Find the tightest common type of two types that might be used in a binary expression. This handles all numeric types except fixed-precision decimals interacting with each other or with primitive types, because in that case the precision and scale of the result depends on the operation. Those rules are implemented in HiveTypeCoercion.DecimalPrecision.
A collection of Rules that can be used to coerce differing types that participate in operations into compatible ones. Most of these rules are based on Hive semantics, but they do not introduce any dependencies on the hive codebase. For this reason they remain in Catalyst until we have a more standard set of coercions.