You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Abhishek Girish (JIRA)" <ji...@apache.org> on 2015/04/23 03:20:38 UTC

[jira] [Reopened] (DRILL-2377) UNION ALL on Aggregates with GROUP BY returns null when column aliases don't match

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

Abhishek Girish reopened DRILL-2377:
------------------------------------

Checked on on Git.Commit.ID a0a1930 (April 21 build)

Query fails with schema change error, even though there isn't any:
{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;

+------------+
|     x      |
+------------+
Query failed: SYSTEM ERROR: Hash aggregate does not support schema changes

Fragment 2:0

[c3ce4d01-8e58-4514-b801-4050ad108392 on abhi8.qa.lab:31010]
java.lang.RuntimeException: java.sql.SQLException: Failure while executing query.
	at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
	at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
	at sqlline.SqlLine.print(SqlLine.java:1809)
	at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
	at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
	at sqlline.SqlLine.dispatch(SqlLine.java:889)
	at sqlline.SqlLine.begin(SqlLine.java:763)
	at sqlline.SqlLine.start(SqlLine.java:498)
	at sqlline.SqlLine.main(SqlLine.java:460)
{code}

> 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.9.0
>            Reporter: Abhishek Girish
>            Assignee: Sean Hsuan-Yi Chu
>             Fix For: 0.8.0
>
>
> 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)