Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-10555 Improve windowing spec of range based windowing to support additional range formats
  3. HIVE-12574

windowing function returns incorrect result when the window size is larger than the partition size

    XMLWordPrintableJSON

Details

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

    Description

      In PTF windowing, when the partition is small and the window size is larger than the partition size, we are seeing incorrect result. It happens for max, min, first_value, last_value and sum functions.

      CREATE TABLE sdy1(
      ord int,
      type string);
      

      The data is:

      2 a
      3 a
      1 a 
      

      The result is as follows for the query select ord, min(ord) over (partition by type order by ord rows between 1 preceding and 7 following)

      1 1
      2 1
      3 1 
      

      The expected result is:

      1 1
      2 1
      3 2
      

      Attachments

        1. HIVE-12574.2.patch
          14 kB
          Aihua Xu
        2. HIVE-12574.patch
          12 kB
          Aihua Xu

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: