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

Julian Hyde commented on CALCITE-1556:
--------------------------------------

Yes, it's a daft query. But it's still a valid query. If you were to change 
{{GROUP BY ss_item_sk}} to {{GROUP BY ss_item_sk, warehouse_id}} it does 
something useful. 

> 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)

Reply via email to