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] [Commented] (DRILL-2376) UNION ALL on Aggregates with GROUP BY returns incomplete results
Date Thu, 23 Apr 2015 18:00:40 GMT

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

Abhishek Girish commented on DRILL-2376:
----------------------------------------

Looks like it is not dependent on format. Issue seen on parquet as well. 

However, on disabling HashAgg, the issue is not seen. 

{code:sql}
> alter session set `planner.enable_hashagg`=false;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | planner.enable_hashagg updated. |
+------------+------------+
1 row selected (0.062 seconds)

SELECT x
FROM
(SELECT Sum(ss_ext_sales_price) x
FROM  store_sales
UNION ALL
SELECT Sum(cs_ext_sales_price) x
FROM catalog_sales) tmp
GROUP BY x;
+------------+
|     x      |
+------------+
| 3.658019159349976E9 |
| 5.26520707451017E9 |
+------------+
2 rows selected (0.472 seconds)
{code}

> UNION ALL on Aggregates with GROUP BY returns incomplete results
> ----------------------------------------------------------------
>
>                 Key: DRILL-2376
>                 URL: https://issues.apache.org/jira/browse/DRILL-2376
>             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 incomplete results:
> {code:sql}
> select x
> from
> (SELECT Sum(ss_ext_sales_price) x
> FROM  store_sales
> UNION ALL
> SELECT Sum(cs_ext_sales_price) x
> FROM catalog_sales) tmp
> GROUP BY x;
> Results from Drill:
> +------------+
> |     x      |
> +------------+
> | 3658019159.35 |
> +------------+
> 1 row selected (3.474 seconds)
> Results from Postgres:
>        x       
> ---------------
>  5265207074.51
>  3658019159.35
> (2 rows)
> {code}
> Removing GROUP BY returns the right results:
> {code:sql}
> select x
> from
> (SELECT Sum(ss_ext_sales_price) x
> FROM  store_sales
> UNION ALL
> SELECT Sum(cs_ext_sales_price) x
> FROM catalog_sales) tmp;
> Results from Drill:
> +------------+
> |     x      |
> +------------+
> | 5265207074.51 |
> | 3658019159.35 |
> +------------+
> {code}



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

Mime
View raw message