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

OVER clauses with BETWEEN in the window definition produce wrong results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 0.11.0
    • None
    • PTF-Windowing
    • None

    Description

      Window queries that define a windowing clause that has a termination row often (though not all) return incorrect results. For example, from our test queries all of the following return incorrect results:

      select s, sum(f) over (partition by t order by b 
             rows between current row and unbounded following) 
      from over100k;
      
      select s, avg(f) over (partition by b order by d 
             rows between 5 preceding and current row) 
      from over100k;
      
      select s, avg(f) over (partition by bin order by s 
             rows between current row and 5 following) 
      from over100k;
      
      select s, avg(d) over (partition by i order by f desc 
             rows between 5 preceding and 5 following) 
      from over100k;
      

      Attachments

        1. Range_5_diff
          357 kB
          Alan Gates

        Activity

          People

            Unassigned Unassigned
            gates Alan Gates
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: