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

Incorrect results when hive.optimize.index.filter=true and same ORC table is referenced twice in query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0, 2.2.0
    • 2.4.0, 3.0.0
    • None
    • None

    Description

      To repro:

      set hive.optimize.index.filter=true;
      
      create table test_table(number int) stored as ORC;
      
      -- Two insertions will create two files, with one stripe each
      insert into table test_table VALUES (1);
      insert into table test_table VALUES (2);
      
      -- This should and does return 2 records
      select * from test_table;
      
      -- These should and do each return 1 record
      select * from test_table where number = 1;
      select * from test_table where number = 2;
      
      -- This should return 2 records but only returns 1 record
      select * from test_table where number = 1
      union all
      select * from test_table where number = 2;
      

      What's happening is only the last predicate is being pushed down.

      Attachments

        1. HIVE-15680.1.patch
          14 kB
          Anthony Hsu
        2. HIVE-15680.2.patch
          15 kB
          Anthony Hsu
        3. HIVE-15680.3.patch
          15 kB
          Anthony Hsu
        4. HIVE-15680.4.patch
          15 kB
          Anthony Hsu
        5. HIVE-15680.5.patch
          15 kB
          Anthony Hsu
        6. HIVE-15680.6.patch
          16 kB
          Anthony Hsu
        7. HIVE-15680.7.patch
          9 kB
          Prasanth Jayachandran

        Issue Links

          Activity

            People

              erwaman Anthony Hsu
              erwaman Anthony Hsu
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: