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

Sean Hsuan-Yi Chu resolved DRILL-2379.
--------------------------------------
    Resolution: Fixed

Resolved in commit #: 0368adf0c

> UNION ALL with ORDER BY fails when column aliases don't match
> -------------------------------------------------------------
>
>                 Key: DRILL-2379
>                 URL: https://issues.apache.org/jira/browse/DRILL-2379
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 0.8.0
>            Reporter: Abhishek Girish
>            Assignee: Sean Hsuan-Yi Chu
>         Attachments: drillbit.log
>
>
> The following query fails to execute:
> {code:sql}
> SELECT x
> FROM
> (SELECT Sum(ss_ext_sales_price) x
> FROM  store_sales
> UNION ALL
> SELECT Sum(cs_ext_sales_price) y
> FROM catalog_sales) tmp
> ORDER BY x;
> SELECT x
> FROM
> (SELECT ss_ext_sales_price x
> FROM  store_sales
> UNION ALL
> SELECT cs_ext_sales_price y
> FROM catalog_sales) tmp
> ORDER BY x;
> SELECT x
> FROM
> (SELECT ss_ext_sales_price x
> FROM  store_sales
> UNION ALL
> SELECT ss_ext_sales_price y
> FROM store_sales) tmp
> ORDER BY x;
> Error from Drill:
> Query failed: RemoteRpcException: Failure while running fragment., Sort 
> doesn't currently support sorts with changing schemas. 
> java.lang.RuntimeException: java.sql.SQLException: Failure while executing 
> query.
> ...
> {code}
> Log snippet attached. 
> Changing the alias from 'y' to 'x' in the second sub-query will solve the 
> issue. 



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

Reply via email to