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

Type conversion during IN () comparisons is using different rules from other comparison operations

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: Types
    • Labels:
      None

      Description

      Noticed this while looking at HIVE-20082.
      The type conversion done during GenericUDFIn (via ReturnObjectInspectorResolver) uses FunctionRegistry.getCommonClass(), whereas the other comparison operators (=, <, >, <=, >=) use FunctionRegistry.getCommonClassForComparison(). As a result, dec_column IN ('1.1', '2.2') compares the values as strings, whereas dec_column = '1.1' would compare the values as doubles. This makes a difference for HIVE-20082 since it is related to changing the 0-padding during decimal-to-string conversions.

      cc Ashutosh Chauhan

        Attachments

        1. HIVE-20204.1.patch
          26 kB
          Jason Dere
        2. HIVE-20204.2.patch
          27 kB
          Jason Dere
        3. HIVE-20204.3.patch
          27 kB
          Jason Dere
        4. HIVE-20204.4.patch
          27 kB
          Jason Dere

          Issue Links

            Activity

              People

              • Assignee:
                jdere Jason Dere
                Reporter:
                jdere Jason Dere
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: