hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajat Khandelwal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-13727) Getting error Failed rule: 'orderByClause clusterByClause distributeByClause sortByClause limitClause can only be applied to the whole union.' in subquery
Date Tue, 10 May 2016 14:30:13 GMT

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

Rajat Khandelwal commented on HIVE-13727:
-----------------------------------------

The issue might be because of HIVE-9039 https://github.com/apache/hive/commit/87a7e134a49df80220a73c48d104d5cea722e76c

> Getting error Failed rule: 'orderByClause clusterByClause distributeByClause sortByClause
limitClause can only be applied to the whole union.' in subquery 
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-13727
>                 URL: https://issues.apache.org/jira/browse/HIVE-13727
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Rajat Khandelwal
>
> The error comes in the following query:
> {noformat}
> SELECT *
> FROM
>   (SELECT *
>    FROM srcpart a
>    WHERE a.ds = '2008-04-08'
>      AND a.hr = '11'
>    ORDER BY a.key LIMIT 5
>    UNION ALL
>    SELECT *
>    FROM srcpart b
>    WHERE b.ds = '2008-04-08'
>      AND b.hr = '14'
>    ORDER BY b.key LIMIT 5) subq
> ORDER BY KEY LIMIT 5
> {noformat}
> But the following query works:
> {noformat}
> SELECT *
> FROM
>   (SELECT *
>    FROM
>      (SELECT *
>       FROM srcpart a
>       WHERE a.ds = '2008-04-08'
>         AND a.hr = '11'
>       ORDER BY a.key LIMIT 5) pa
>    UNION ALL SELECT *
>    FROM
>      (SELECT *
>       FROM srcpart b
>       WHERE b.ds = '2008-04-08'
>         AND b.hr = '14'
>       ORDER BY b.key LIMIT 5) pb) subq
> ORDER BY KEY LIMIT 5
> {noformat}
> The queries are logically identical, the query that's rejected has dummy select * clauses
around the sub-queries. 



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

Mime
View raw message