Xuefu Zhang created HIVE-5848:
---------------------------------
Summary: Hive's type promotion isn't correct
Key: HIVE-5848
URL: https://issues.apache.org/jira/browse/HIVE-5848
Project: Hive
Issue Type: Improvement
Affects Versions: 0.12.0, 0.11.0, 0.10.0
Reporter: Xuefu Zhang
Assignee: Xuefu Zhang
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.
--
This message was sent by Atlassian JIRA
(v6.1#6144)