drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victoria Markman (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DRILL-3238) Cannot Plan Exception is raised when the same window partition is defined in select & window clauses
Date Sat, 27 Jun 2015 16:16:04 GMT

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

Victoria Markman edited comment on DRILL-3238 at 6/27/15 4:15 PM:
------------------------------------------------------------------

Interestingly, this case "over W" works:

{code}
select sum(a2) over w, count(*) over(partition by a2 order by a2) from t2 window w as (partition
by a2 order by a2);
{code}

I did not realize that over(W) is the supported grammar ...


was (Author: vicky):
Interestingly, this case "over W" works:

{code}
select sum(a2) over w, count(*) over(partition by a2 order by a2) from t2 window w as (partition
by a2 order by a2);
{code}

I did not realized that over(W) is the supported grammar ...

> Cannot Plan Exception is raised when the same window partition is defined in select &
window clauses
> ----------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-3238
>                 URL: https://issues.apache.org/jira/browse/DRILL-3238
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Sean Hsuan-Yi Chu
>            Assignee: Sean Hsuan-Yi Chu
>              Labels: window_function
>             Fix For: Future
>
>
> While this works:
> {code}
> select sum(a2) over(partition by a2 order by a2), count(*) over(partition by a2 order
by a2) 
> from t
> {code}
> , this fails
> {code}
> select sum(a2) over(w), count(*) over(partition by a2 order by a2) 
> from t
> window w as (partition by a2 order by a2)
> {code}
> Notice these two queries are logically the same thing if we plug-in the window definition
back into the SELECT-CLAUSE in the 2nd query.



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

Mime
View raw message