Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-24534

Prevent comparisons between characters and decimals types when strict checks enabled

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m