You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/10/18 15:39:00 UTC

[jira] [Commented] (DRILL-5845) Columns returned by select with "ORDER BY" and "LIMIT" clauses are not in correct order.

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

ASF GitHub Bot commented on DRILL-5845:
---------------------------------------

GitHub user vdiravka opened a pull request:

    https://github.com/apache/drill/pull/1000

    DRILL-5845: Columns returned by select with "ORDER BY" and "LIMIT" cl…

    …auses are not in correct order.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vdiravka/drill DRILL-5845

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/1000.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1000
    
----
commit 1847a65a322ed0f4b38dd202a79b8f2078ca1a11
Author: Vitalii Diravka <vi...@gmail.com>
Date:   2017-10-09T11:27:58Z

    DRILL-5845: Columns returned by select with "ORDER BY" and "LIMIT" clauses are not in correct order.

----


> Columns returned by select with "ORDER BY" and "LIMIT" clauses are not in correct order.
> ----------------------------------------------------------------------------------------
>
>                 Key: DRILL-5845
>                 URL: https://issues.apache.org/jira/browse/DRILL-5845
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.11.0
>            Reporter: Vitalii Diravka
>            Assignee: Vitalii Diravka
>             Fix For: Future
>
>
> Column order is proper for queries with only one clause: ORDER BY or LIMIT. For queries with both these clauses column order isn't preserved.
> Test case for reproduce:
> {code}
> 0: jdbc:drill:zk=local> select * from cp.`tpch/nation.parquet` limit 1;
> +--------------+----------+--------------+------------------------------------------------------+
> | n_nationkey  |  n_name  | n_regionkey  |                      n_comment                       |
> +--------------+----------+--------------+------------------------------------------------------+
> | 0            | ALGERIA  | 0            |  haggle. carefully final deposits detect slyly agai  |
> +--------------+----------+--------------+------------------------------------------------------+
> 1 row selected (0.181 seconds)
> 0: jdbc:drill:zk=local> select * from cp.`tpch/nation.parquet` order by n_name limit 1;
> +------------------------------------------------------+----------+--------------+--------------+
> |                      n_comment                       |  n_name  | n_nationkey  | n_regionkey  |
> +------------------------------------------------------+----------+--------------+--------------+
> |  haggle. carefully final deposits detect slyly agai  | ALGERIA  | 0            | 0            |
> +------------------------------------------------------+----------+--------------+--------------+
> 1 row selected (0.154 seconds)
> {code}
> For json files the column ordering is not preserved as well:
> {code}
> select * from cp.`employee.json` limit 1;
> select * from cp.`employee.json` order by full_name limit 1;
> {code}
> Perhaps the wrong operator for sorting is used.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)