Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
When we compare decimal and character types implicit conversions take place that can lead to unexpected and surprising results.
create table t_str (str_col string); insert into t_str values ('1208925742523269458163819');select * from t_str where str_col=1208925742523269479013976;
The SELECT query brings up one row while the filtering value is not the same with the one present in the string column of the table. The problem is that both types are converted to doubles and due to loss of precision the values are deemed equal.
Even if we change the implicit conversion to use another type (HIVE-24528) there are always some cases that may lead to unexpected results.
The goal of this issue is to prevent comparisons between decimal and character types when hive.strict.checks.type.safety is enabled and throw an error.
Attachments
Issue Links
- contains
-
HIVE-24646 Strict type checks are not enforced between bigints and doubles
- Closed
- is related to
-
HIVE-24538 Enforce strict type checks on all operators relying on comparisons
- Open
- relates to
-
HIVE-24528 Wrong implicit type conversion when comparing decimals and strings
- Open
-
HIVE-22080 Prevent implicit conversion from String/char/varchar to double/decimal
- Closed
-
HIVE-13958 hive.strict.checks.type.safety should apply to decimals, as well as IN... and BETWEEN... ops
- Patch Available
- links to