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

Top N Key Operator should not be allowed to pass through group by with grouping sets

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Operators
    • None

    Description

      HIVE-22652 enabled the Top N Key operator to be pushed down through a group by with grouping sets, but I think I have an example where this isn't correct.

      If I take the following query:

      SELECT a, b, sum(c) FROM t_test_grouping_sets GROUP BY a,b GROUPING SETS (()) ORDER BY b DESC  LIMIT 1;

      If we were to push the Top N Key operator all the way to the top, it would produce incorrect results.   We need to calculate the sum for all rows in the query, so we don't want to limit the rows that are passed through.

      Attachments

        Activity

          People

            Unassigned Unassigned
            scarlin Steve Carlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: