drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aman Sinha (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-724) select two columns with order by produce wrong results
Date Tue, 27 May 2014 21:13:01 GMT

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

Aman Sinha commented on DRILL-724:
----------------------------------

Since the values of the the two columns get swapped for certain rows, I suspected that some
column projections may not be right.  If I insert a  Project right after the SelectionVectorRemover
and before the SingleMergeExchange, the results are correct.  The modified part of the plan
is below (the new Project is id: 100).   This indicates  that in the absence of a Project,
somehow the order of the columns fed into the SingleMergeExchange is not right on all the
nodes.  
...
...
 }, {
    "pop" : "external-sort",
    "@id" : 65538,
    "child" : 65539,
    "orderings" : [ {
      "order" : "ASC",
      "expr" : "`c_row`",
      "nullDirection" : "UNSPECIFIED"
    } ],
    "reverse" : false,
    "initialAllocation" : 1000000,
    "maxAllocation" : 10000000000
  }, {
    "pop" : "selection-vector-remover",
    "@id" : 65537,
    "child" : 65538,
    "initialAllocation" : 1000000,
    "maxAllocation" : 10000000000
  }, {
    "pop" : "project",
    "@id" : 100,
    "exprs" : [ {
      "ref" : "`c_row`",
      "expr" : "`c_row`"
    }, {
      "ref" : "`c_int`",
      "expr" : "`c_int`"
    } ],
    "child" : 65537,
    "initialAllocation" : 1000000,
    "maxAllocation" : 10000000000
  }, {
    "pop" : "single-merge-exchange",
    "@id" : 2,
    "child" : 100,
    "orderings" : [ {
      "order" : "ASC",
      "expr" : "`c_row`",
      "nullDirection" : "UNSPECIFIED"
    } ],
    "initialAllocation" : 1000000,
    "maxAllocation" : 10000000000
  }, {
...
...

> select two columns with order by produce wrong results
> ------------------------------------------------------
>
>                 Key: DRILL-724
>                 URL: https://issues.apache.org/jira/browse/DRILL-724
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Chun Chang
>            Priority: Blocker
>
> postgres:
> foodmart=# select c_row, c_int from data order by c_row;
>  c_row |    c_int
> -------+-------------
>      1 |           0
>      2 |           1
>      3 |          -1
>      4 |          12
>      5 |         123
>      6 |    92032039
>      7 |   -23395000
>      8 |   -99392039
>      9 | -2147483648
>     10 |  2147483647
>     11 |       32767
>     12 |      -32767
>     13 |       49032
>     14 |    -4989385
>     15 |    69834830
>     16 |         243
>     17 |     -426432
>     18 |       -3904
>     19 |   489392758
>     20 |   589032574
>     21 |   340000504
>     22 |           0
>     23 |           1
> (23 rows)
> drill:
> 0: jdbc:drill:schema=dfs> select c_row, c_int from data order by c_row;
> +------------+------------+
> |   c_int    |   c_row    |
> +------------+------------+
> | 1          | 0          |
> | 1          | 2          |
> | -1         | 3          |
> | 12         | 4          |
> | 123        | 5          |
> | 92032039   | 6          |
> | -23395000  | 7          |
> | -99392039  | 8          |
> | -2147483648 | 9          |
> | 10         | 2147483647 |
> | 32767      | 11         |
> | -32767     | 12         |
> | 13         | 49032      |
> | -4989385   | 14         |
> | 69834830   | 15         |
> | 243        | 16         |
> | -426432    | 17         |
> | -3904      | 18         |
> | 489392758  | 19         |
> | 589032574  | 20         |
> | 340000504  | 21         |
> | 22         | 0          |
> | 1          | 23         |
> +------------+------------+
> 23 rows selected (10.932 seconds)
> notice for drill, on some of the rows, the columns are exchanged.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message