Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-10142 Calculating formula based on difference between each row's value and current row's in Windowing function
  3. HIVE-11025

In windowing spec, when the datatype is decimal, it's comparing the value against NULL value incorrectly

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • PTF-Windowing
    • None

    Description

      Given data and the following query,

      deptno  empno  bonus    salary
      30        7698         NULL    2850.0 
      30        7900         NULL    950.0 
      30        7844         0       1500.0 
      
      select avg(salary) over (partition by deptno order by bonus range 200 preceding) from emp2;
      

      It produces incorrect result for the row in which bonus=0
      1900.0
      1900.0
      1766.6666666666667

      Attachments

        1. HIVE-11025.patch
          15 kB
          Aihua Xu

        Issue Links

          Activity

            People

              aihuaxu Aihua Xu
              aihuaxu Aihua Xu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: