Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1433

Min/max analytic fns should support windows that can be rewritten to be unbounded preceding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Impala 2.1
    • Impala 2.1
    • None
    • None

    Description

      We currently don't support executing min/max over sliding windows (i.e. start is not unbounded), but we should support them if we can re-write the window to be unbounded preceding (i.e. because the end is unbounded we can flip the window and sort).

      E.g.

      Query: select MAX(bigint_col) OVER (ORDER BY int_col ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM alltypes t1
      ERROR: AnalysisException: 'max(bigint_col)' is only supported with an UNBOUNDED PRECEDING start bound.
      

      This query should be re-written to be "... order by int_col desc rows between unbounded preceding and current row" and then we can execute it.

      Attachments

        Activity

          People

            mjacobs Matthew Jacobs
            caseyc casey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: