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

Union Operator may produce incorrect result on TEZ

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.14.0, 1.0.0, 1.0.1, 1.1.0, 1.2.1
    • 2.0.0
    • Hive
    • None

    Description

      Union queries may produce incorrect result on TEZ.
      TEZ removes union op, thus might loose the implicit cast in union op.

      Reproduction test case:

      set hive.cbo.enable=false;
      set hive.execution.engine=tez;
      select (x/sum(x) over())  as y from(select cast(1 as decimal(10,0))  as x from (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) x from (select * from src limit 2) s2 union all select '100000000' x from (select * from src limit 2) s3)u order by y;
      
      select (x/sum(x) over()) as y from(select cast(1 as decimal(10,0))  as x from (select * from src limit 2)s1 union all select cast(1 as decimal(10,0)) x from (select * from src limit 2) s2 union all select cast (null as string) x from (select * from src limit 2) s3)u order by y;
      

      Attachments

        1. HIVE-12384.4.patch
          9 kB
          Laljo John Pullokkaran
        2. HIVE-12384.3.patch
          13 kB
          Laljo John Pullokkaran
        3. HIVE-12384.2.patch
          45 kB
          Laljo John Pullokkaran
        4. HIVE-12384.1.patch
          9 kB
          Laljo John Pullokkaran

        Issue Links

          Activity

            People

              jpullokkaran Laljo John Pullokkaran
              jpullokkaran Laljo John Pullokkaran
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: