Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
0.10.0, 0.11.0, 0.12.0
-
None
-
None
-
None
Description
When dealing with union all, arithmetic operators, and other places when type promotion is needed or a common type is determined, Hive would promote non-exact data types (float and double) to HiveDecimal. However, HIveDecimal is an exact type. Promoting a non-exact type to an exact type makes a false impression to the user that the data is exact. For instance, expression 3.14 + 3.14BD produces an HiveDecimal number 6.28. However, the two are not equivalent, as the left operand is not exact. MySQL in this case produces a double 6.28, which is more reasonable.
The problem was discovered in HIVE-3976. HIVE-5356 solves the problem for arithmetic operators, but there are more places where the problem exists. For instance, HIVE-5825 manifested the same issue.
The purpose of this JIRA is to revisit the type casting and type promotion to make HIVE's behavior more in line with standard or other major database implementations.
Attachments
Issue Links
- duplicates
-
HIVE-13380 Decimal should have lower precedence than double in type hierachy
- Resolved