Julian Hyde created CALCITE-1822:
------------------------------------

             Summary: Push Aggregate that follows Aggregate down to Druid
                 Key: CALCITE-1822
                 URL: https://issues.apache.org/jira/browse/CALCITE-1822
             Project: Calcite
          Issue Type: Bug
          Components: druid
            Reporter: Julian Hyde
            Assignee: Julian Hyde


Push Aggregate that follows Aggregate down to Druid. This can occur if the SQL 
has an aggregate function applied to an aggregate function, or with a sub-query 
in the FROM clause.

{code}
SELECT MAX(COUNT(*))
FROM Emp
GROUP BY deptno

SELECT MAX(c) FROM (
  SELECT deptno, COUNT(*) AS c
  FROM Emp
  GROUP BY deptno)
{code}

And there are other possibilities where there is a Project and/or a Filter 
after the first Aggregate and before the second Aggregate.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to