drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deneche A. Hakim (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DRILL-3327) row_number function returns incorrect result when only order by clause is specified
Date Tue, 23 Jun 2015 17:16:01 GMT

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

Deneche A. Hakim edited comment on DRILL-3327 at 6/23/15 5:15 PM:
------------------------------------------------------------------

Let me investigate this issue, there may be a bug in DefaultFrameTemplate: although the implementation
can start processing batches before all batches for the current partition have been received,
the inner Partition class actually assumes all rows of the current partition have been retrieved.
If this is the case then although the patch fixes the cases when PARTITION BY is missing,
we may still be hitting this issue elsewhere.


was (Author: adeneche):
Let me investigate this issue, there may be a bug in DefaultFrameTemplate: although the implementation
can start processing batches before all batches has been received, the inner Partition class
actually assumes all rows of the current partition have been retrieved.
If this is the case then although the patch fixes the cases when PARTITION BY is missing,
we may still be hitting this issue elsewhere.

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

Mime
View raw message