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

Deneche A. Hakim commented on DRILL-3327:
-----------------------------------------

looks like my hack to MSorter to control the size of batches incomplete and the 
window function unit tests weren't actually testing multiple batches but just 
one single big batch. I updated MSorter and now 2 unit tests are failing 
probably related to this issue.

As I suspected, this issue can also occur even when the PARTITION BY clause 
exists. I will create a separate JIRA to fix the unit tests and see if this 
issue still occurs.

Thanks!

> row_number function returns incorrect result when only order by clause is 
> specified
> -----------------------------------------------------------------------------------
>
>                 Key: DRILL-3327
>                 URL: https://issues.apache.org/jira/browse/DRILL-3327
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.0.0
>            Reporter: Victoria Markman
>            Assignee: Aman Sinha
>            Priority: Critical
>              Labels: window_function
>             Fix For: 1.1.0
>
>         Attachments: 
> 0001-DRILL-3327-If-no-partition-by-is-specified-read-all-.patch, j1.tar, 
> row_number_wrong_result.tar
>
>
> Queries returning wrong result:
> {code}
> select c_integer, row_number() over(order by c_integer) from j1 order by 2;
> select c_integer, row_number() over(order by c_integer) from j1 order by 2 
> desc;
> select c_integer, row_number() over(order by c_integer desc) from j1 order by 
> 2;
> select c_integer, row_number() over(order by c_integer desc) from j1 order by 
> 2;
> select c_integer, row_number() over(order by c_integer nulls first) from j1 
> order by c_integer nulls last,  row_number() over(order by c_integer nulls 
> first);
> select c_integer, row_number() over(order by c_integer nulls last) from j1 
> order by c_integer nulls first, row_number() over(order by c_integer nulls 
> last);
> {code}
> In attached tar file (row_number_wrong_result.tar) you will find:
> 1. *.sql - file that contains query
> 2. *.res - expected result (generated from Postgres)
> 3. *.out - result returned by drill



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

Reply via email to