You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Gautam Kumar Parai (JIRA)" <ji...@apache.org> on 2016/08/02 18:10:20 UTC

[jira] [Comment Edited] (CALCITE-1340) Window aggregates invalid error/error messages in some cases

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

Gautam Kumar Parai edited comment on CALCITE-1340 at 8/2/16 6:09 PM:
---------------------------------------------------------------------

Q4 occurs when Q3 is fixed. Otherwise, it does not occur since we miss to check the WINDOW clause.


was (Author: gparai):
Q4 occurs when we Q3 is fixed. Otherwise, it does not occur since we miss to check the WINDOW clause.

> Window aggregates invalid error/error messages in some cases
> ------------------------------------------------------------
>
>                 Key: CALCITE-1340
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1340
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Gautam Kumar Parai
>            Assignee: Gautam Kumar Parai
>
> Queries which fail (or fail with inconsistent errors)
> Q1:
> {code}select count( * ) over () from emp group by deptno 
> AssertionError: star should have been expanded.
> {code}
> Q2:
> {code}
> SELECT sum(empno), max(empno) OVER (order by deptno) 
> FROM emp 
> GROUP BY empno 
> gives error: Expression 'DEPTNO' is not being grouped
> SELECT sum(empno), max(empno) OVER w 
> FROM emp 
> GROUP BY empno 
> WINDOW w as (order by deptno)
> gives no error:
> {code}
> Q3:
> {code}
> SELECT sum(empno), max(empno) OVER (order by deptno) 
> FROM emp 
> GROUP BY empno 
> gives error: Expression 'DEPTNO' is not being grouped
> SELECT sum(empno), max(empno) OVER w 
> FROM emp 
> GROUP BY empno 
> WINDOW w as (order by deptno)
> gives no error:
> {code}
> Q4:
> {code}
> select cume_dist() over w , rank() 
> from emp 
> window w as (partition by deptno order by deptno)
> Assertion Error: Expression 'DEPTNO' is not being grouped
> instead of 
> Assertion Error: OVER clause is necessary for window functions
> {code}



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