You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jess Balint (JIRA)" <ji...@apache.org> on 2017/03/29 22:02:41 UTC

[jira] [Commented] (CALCITE-1556) Window validation bug with order by agg

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

Jess Balint commented on CALCITE-1556:
--------------------------------------

What does it mean to order by an aggregate in the window expression? The GROUP BY is the same as the window partition key so you will always have rank = 1.

> Window validation bug with order by agg
> ---------------------------------------
>
>                 Key: CALCITE-1556
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1556
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Baofeng Zhang
>            Assignee: Julian Hyde
>
> I found a window validation bug when the agg on order by does not occur in select clause.
> {quote}
> SELECT RANK() OVER (PARTITION BY ss_item_sk ORDER BY SUM(ss_net_profit) DESC) AS ranking
> FROM tpcds.store_sales
> GROUP BY ss_item_sk
> {quote}



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