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

Vectorized execution handles overflows in a different manner than non-vectorized execution

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1, 2.2.0, 2.3.2, 3.0.0
    • 3.0.0
    • Vectorization
    • None

    Description

      In vectorized execution arithmetic operations which cause integer overflows can give wrong results. Issue is reproducible in both Orc and parquet.

      Simple test case to reproduce this issue

      set hive.vectorized.execution.enabled=true;
      create table parquettable (t1 tinyint, t2 tinyint) stored as parquet;
      insert into parquettable values (-104, 25), (-112, 24), (54, 9);
      select t1, t2, (t1-t2) as diff from parquettable where (t1-t2) < 50 order by diff desc;
      +-------+-----+-------+
      |  t1   | t2  | diff  |
      +-------+-----+-------+
      | -104  | 25  | 127   |
      | -112  | 24  | 120   |
      | 54    | 9   | 45    |
      +-------+-----+-------+
      

      When vectorization is turned off the same query produces only one row.

      Attachments

        1. HIVE-18421.01.patch
          111 kB
          Vihang Karajgaonkar
        2. HIVE-18421.02.patch
          111 kB
          Vihang Karajgaonkar
        3. HIVE-18421.03.patch
          130 kB
          Vihang Karajgaonkar
        4. HIVE-18421.04.patch
          134 kB
          Vihang Karajgaonkar
        5. HIVE-18421.05.patch
          144 kB
          Vihang Karajgaonkar
        6. HIVE-18421.06.patch
          144 kB
          Vihang Karajgaonkar
        7. HIVE-18421.07.patch
          144 kB
          Vihang Karajgaonkar
        8. HIVE-18421.08.patch
          147 kB
          Vihang Karajgaonkar

        Issue Links

          Activity

            People

              vihangk1 Vihang Karajgaonkar
              vihangk1 Vihang Karajgaonkar
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: