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/03/04 18:26:04 UTC

[jira] [Comment Edited] (DRILL-2376) UNION ALL on Aggregates with GROUP BY returns incomplete results

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

Abhishek Girish edited comment on DRILL-2376 at 3/4/15 5:25 PM:
----------------------------------------------------------------

I've marked them as related for now. Will mark it as Duplicate once we have more clarity if they are indeed the same issue. 

Actually I found that each variant of a query I was working on behaved quite differently - sometimes wrong results, sometimes incomplete results, sometimes exceptions - so thought I'll log them individually, to keep track of them. They might be related, or might not be. I wasn't very sure.  


was (Author: agirish):
I've marked them as related for now. Will mark it as Duplicate once we have more clarity as they are indeed the same issue. 

Actually I found that each variant of a query I was working on behaved quite differently - sometimes wrong results, sometimes incomplete results, sometimes exceptions - so thought I'll log them individually, to keep track of them. They might be related, or might not be. I wasn't very sure.  

> 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.8.0
>            Reporter: Abhishek Girish
>            Assignee: Jinfeng Ni
>
> 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)