drill-issues 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-2377) UNION ALL on Aggregates with GROUP BY returns null when column aliases don't match
Date Wed, 04 Mar 2015 03:49:05 GMT
Abhishek Girish created DRILL-2377:
--------------------------------------

             Summary: UNION ALL on Aggregates with GROUP BY returns null when column aliases
don't match
                 Key: DRILL-2377
                 URL: https://issues.apache.org/jira/browse/DRILL-2377
             Project: Apache Drill
          Issue Type: Bug
          Components: Query Planning & Optimization
    Affects Versions: 0.8.0
            Reporter: Abhishek Girish
            Assignee: Jinfeng Ni


The following query returns null :
{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
GROUP BY x;

Results from Drill:
+------------+
|     x      |
+------------+
| null       |
+------------+
1 row selected (3.458 seconds)

Results from Postgres:
       x       
---------------
 3658019159.35
 5265207074.51
(2 rows)
{code}

Removing the GROUP BY returns correct results:
{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

Results from Drill:
+------------+
|     x      |
+------------+
| 5265207074.51 |
| 3658019159.35 |
+------------+
2 rows selected (3.46 seconds)
{code}



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

Mime
View raw message