Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4F5217B57 for ; Thu, 23 Apr 2015 03:19:39 +0000 (UTC) Received: (qmail 6528 invoked by uid 500); 23 Apr 2015 03:19:39 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 6026 invoked by uid 500); 23 Apr 2015 03:19:38 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 6014 invoked by uid 99); 23 Apr 2015 03:19:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2015 03:19:38 +0000 Date: Thu, 23 Apr 2015 03:19:38 +0000 (UTC) From: "Sean Hsuan-Yi Chu (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-2376) UNION ALL on Aggregates with GROUP BY returns incomplete results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14508372#comment-14508372 ] Sean Hsuan-Yi Chu commented on DRILL-2376: ------------------------------------------ That is rather weird. I use cp.`tpch/region.parquet`'s data: select x from (SELECT cast(Sum(r_regionkey) as double) x FROM cp.`tpch/region.parquet` UNION ALL SELECT cast(Sum(r_regionkey) as int) y FROM cp.`tpch/region.parquet`) tmp GROUP BY x ORDER BY x; It worked fine even when I fed different types of data into union-all. Can you verify the data type of Sum(.) 's output? > 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)