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

Bad result using UNION with same table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 1.2.1
    • None
    • hpl/sql
    • None
    • engine = mr

      TBLPROPERTIES(
          'auto.purge'='true',
          'orc.compress'='ZLIB',
          'serialization.null.format'=''
      )

       

    Description

      Hi,

      I have a table named "sau' with 1000 rows.

      The table structure is :
       

      col_name data_type comment
      id string  
      mnta int  
      mntb int  

      select id, 'A' as info, mntA as mnt from sau
      union
      select id, 'B' as info, mntB as mnt from sau

      ==> return only rows with "info=B"

      with
      cte_union as (
      select id, 'A' as info, mntA as mnt from sau
      union
      select id, 'B' as info, mntB as mnt from sau
      )
      select
      count
      from
      cte_union

      ==> return 1000 but should be 2000
       
      I don't know if this bug is fixed on new version.

      Using "union all" clause, the result is correct.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Andreu Stéphane
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: