You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/06/03 21:37:37 UTC

[jira] [Commented] (CALCITE-750) Window aggregate on top of a regular aggregate expression fails

    [ https://issues.apache.org/jira/browse/CALCITE-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571533#comment-14571533 ] 

Julian Hyde commented on CALCITE-750:
-------------------------------------

The query is valid (i.e. has well-defined semantics) but IIRC the SQL standard disallows aggregates on top of windowed aggregates (or indeed windowed aggregates on top of windowed aggregates).

> Window aggregate on top of a regular aggregate expression fails
> ---------------------------------------------------------------
>
>                 Key: CALCITE-750
>                 URL: https://issues.apache.org/jira/browse/CALCITE-750
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.3.0-incubating
>            Reporter: Aman Sinha
>            Assignee: Julian Hyde
>
> Window aggregate on top of a regular aggregate expression is a valid query but currently fails with a 'aggregate expression cannot be nested'  error. 
> {code}
> SELECT avg(sum(sal)) over (partition by deptno) from emp group by deptno;
> SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Aggregate expressions cannot be nested
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)