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

Csaba Ringhofer commented on HIVE-27418:
----------------------------------------

[~zhangbutao]
The Hive version was the dependency of Apache Impala which is a Cloudera 
version of Hive. 
(https://github.com/apache/impala/blob/81a41fca6dee014f11695f553ecdb6c82a172d0a/bin/impala-config.sh#L221)
 I am not familiar with upstream Hive so I haven't reproduced it on master yet.

The execution engine is Tez .

> UNION ALL + ORDER BY ordinal works incorrectly for all const queries
> --------------------------------------------------------------------
>
>                 Key: HIVE-27418
>                 URL: https://issues.apache.org/jira/browse/HIVE-27418
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Csaba Ringhofer
>            Priority: Major
>
> For the following query I get results in wrong order:
> SELECT '1', 'b' UNION ALL SELECT '2', 'a'  ORDER BY 2;
> +------+------+
> | _c0  | _c1  |
> +------+------+
> | 1    | b    |
> | 2    | a    |
> +------+------+
> I get correct results if:
> - the column has an alias
> - the same rows come from tables
> - the UNION ALL part of the query is in a sub-query and ORDER BY is run on 
> the sub*query
>  Checked with postgres and Apache Impala and they apply ORDER BY correctly.
> (also noted the the ordinal after ORDER BY is not checked, so it could be 20 
> and Hive doesn't complain)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to