Casts to/from BooleanType are transformed into comparisons since the JVM does not consider Booleans to be numeric types.
Changes Boolean values to Bytes so that expressions like true < false can be Evaluated.
Coerces the type of different branches of a CASE WHEN statement to a common type.
Converts string "NaN"s that are in binary operators with a NaN-able types (Float / Double) to the appropriate numeric equivalent.
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.
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.
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.