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

Using exists may lead to incorrect results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • None
    • None

    Description

      drop table if exists tx1;
      create table tx1 (a integer,b integer);
      insert into tx1	values  (1, 1),
                              (1, 2),
                              (1, 3);
      
      select count(*) as result,3 as expected from tx1 u
      where exists (select * from tx1 v where u.a=v.a and u.b <> v.b);
      
      select count(*) as result,3 as expected from tx1 u
      where exists (select * from tx1 v where u.a=v.a and u.b <> v.b limit 1);
      

      current results are 6 and 2.

      Attachments

        1. HIVE-17726.1.patch
          337 kB
          Vineet Garg
        2. HIVE-17726.2.patch
          430 kB
          Vineet Garg
        3. HIVE-17726.3.patch
          483 kB
          Vineet Garg

        Issue Links

          Activity

            People

              vgarg Vineet Garg
              kgyrtkirk Zoltan Haindrich
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: