drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhishek Girish (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-2379) UNION ALL with ORDER BY fails when column aliases don't match
Date Wed, 04 Mar 2015 04:33:05 GMT
Abhishek Girish created DRILL-2379:
--------------------------------------

             Summary: 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: Jinfeng Ni


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)

Mime
View raw message