You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Pengcheng Xiong (JIRA)" <ji...@apache.org> on 2015/02/09 22:42:34 UTC

[jira] [Resolved] (HIVE-9002) union all does not generate correct result for order by and limit

     [ https://issues.apache.org/jira/browse/HIVE-9002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pengcheng Xiong resolved HIVE-9002.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.2.0

resolved in HIVE-9039

> union all does not generate correct result for order by and limit
> -----------------------------------------------------------------
>
>                 Key: HIVE-9002
>                 URL: https://issues.apache.org/jira/browse/HIVE-9002
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Pengcheng Xiong
>            Assignee: Pengcheng Xiong
>             Fix For: 1.2.0
>
>
> Right now if we have
> select col from A
> union all
> select col from B [Operator]
> it is treated as
> (select col from A)
> union all
> (select col from B [Operator])
> Although it is correct for where, group by (having) join operators, it is not correct for order by and limit operators. They should be
> (select col from A
> union all
> select col from B) [order by, limit]
> For order by, we can refer to MySQL, Oracle, DB2
> mysql
> http://dev.mysql.com/doc/refman/5.1/en/union.html
> oracle
> https://docs.oracle.com/cd/E17952_01/refman-5.0-en/union.html
> ibm
> http://www-01.ibm.com/support/knowledgecenter/ssw_i5_54/sqlp/rbafykeyu.htm



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