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-3204) Problem in name resolution with window functions
Date Thu, 11 Jun 2015 22:41:00 GMT

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

Victoria Markman edited comment on DRILL-3204 at 6/11/15 10:40 PM:
-------------------------------------------------------------------

If I add "order by" in the OVER clause, query works:  
select sum(t1.a1) over(partition by t1.b1 {color:red}order by t1.b1 {color})  from t1, t2
where t1.c1 = t2.c2 group by t1.a1, t1.b1;

So our earlier assesement of  Abhishek's query that worked is wrong (we thought that alias
makes a difference)


was (Author: vicky):
It is also very strange that if I add "order by" in the OVER clause, query works:  select
sum(t1.a1) over(partition by t1.b1 {color:red}order by t1.b1{color} )  from t1, t2 where t1.c1
= t2.c2 group by t1.a1, t1.b1;



> Problem in name resolution with window functions
> ------------------------------------------------
>
>                 Key: DRILL-3204
>                 URL: https://issues.apache.org/jira/browse/DRILL-3204
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.0.0
>            Reporter: Victoria Markman
>            Assignee: Sean Hsuan-Yi Chu
>            Priority: Blocker
>              Labels: window_function
>             Fix For: 1.1.0
>
>
> Trying to use window functions with the join and window aggregate function on one of
the columns coming out of join, get an error:
> {code}
> 0: jdbc:drill:schema=dfs> select sum(t1.a1) over(partition by t1.b1)  from t1, t2
where t1.c1 = t2.c2 group by t1.a1, t1.b1;
> Error: PARSE ERROR: At line 0, column 0: Column 'a1' is ambiguous
> [Error Id: 3a6c4906-c48f-41c7-b9e1-3f59a951e55f on atsqa4-133.qa.lab:31010] (state=,code=0)
> {code}
> Tables used in the query:
> {code}
> 0: jdbc:drill:schema=dfs> select * from t1 limit 1;
> +-----+--------+-------------+
> | a1  |   b1   |     c1      |
> +-----+--------+-------------+
> | 1   | aaaaa  | 2015-01-01  |
> +-----+--------+-------------+
> 1 row selected (0.133 seconds)
> 0: jdbc:drill:schema=dfs> select * from t2 limit 1;
> +-----+------+-------------+
> | a2  |  b2  |     c2      |
> +-----+------+-------------+
> | 0   | zzz  | 2014-12-31  |
> +-----+------+-------------+
> 1 row selected (0.121 seconds)
> {code}



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

Mime
View raw message