Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6175

Windowing functions don't allow aggregates in over clause (incorrectly)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.12.0
    • None
    • SQL Parser
    • None

    Description

      Windowing functions should allow aggregate functions in the over() clause, but do not.

      This query:

      select pay_period, sum(money) as sum_money
      , rank() over(order by sum(money)) as rnk
      from (values (1,200), (1,40), (2,30), (2, 239), (3,1)) base(pay_period, money)
      group by pay_period

      should work, but does not, and returns this error:

      SYSTEM ERROR: AssertionError: Internal error: invariant violated: conversion result not null

      [Error Id: 8df6f6f1-41af-42b3-95d5-b2117b49bec5 on <host>:31010]

      This should be allowed in standards, and doable.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cbc Chris
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: