Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-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 ED07E1849F for ; Wed, 13 Jan 2016 16:02:41 +0000 (UTC) Received: (qmail 31533 invoked by uid 500); 13 Jan 2016 16:02:40 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 31420 invoked by uid 500); 13 Jan 2016 16:02:40 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 31246 invoked by uid 99); 13 Jan 2016 16:02:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2016 16:02:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 5F89F2C1F7F for ; Wed, 13 Jan 2016 16:02:40 +0000 (UTC) Date: Wed, 13 Jan 2016 16:02:40 +0000 (UTC) From: "Chaoyu Tang (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-12788) Setting hive.optimize.union.remove to TRUE will break UNION ALL with aggregate functions 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/HIVE-12788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chaoyu Tang updated HIVE-12788: ------------------------------- Attachment: HIVE-12788-branch-1.patch > Setting hive.optimize.union.remove to TRUE will break UNION ALL with aggregate functions > ---------------------------------------------------------------------------------------- > > Key: HIVE-12788 > URL: https://issues.apache.org/jira/browse/HIVE-12788 > Project: Hive > Issue Type: Bug > Components: Hive > Affects Versions: 1.1.1 > Reporter: Eric Lin > Assignee: Chaoyu Tang > Attachments: HIVE-12788-branch-1.patch, HIVE-12788.1.patch, HIVE-12788.patch > > > See the test case below: > {code} > 0: jdbc:hive2://localhost:10000/default> create table test (a int); > 0: jdbc:hive2://localhost:10000/default> insert overwrite table test values (1); > 0: jdbc:hive2://localhost:10000/default> set hive.optimize.union.remove=true; > No rows affected (0.01 seconds) > 0: jdbc:hive2://localhost:10000/default> set hive.mapred.supports.subdirectories=true; > No rows affected (0.007 seconds) > 0: jdbc:hive2://localhost:10000/default> SELECT COUNT(1) FROM test UNION ALL SELECT COUNT(1) FROM test; > +----------+--+ > | _u1._c0 | > +----------+--+ > +----------+--+ > {code} > UNION ALL without COUNT function will work as expected: > {code} > 0: jdbc:hive2://localhost:10000/default> select * from test UNION ALL SELECT * FROM test; > +--------+--+ > | _u1.a | > +--------+--+ > | 1 | > | 1 | > +--------+--+ > {code} > Run the same query without setting hive.mapred.supports.subdirectories and hive.optimize.union.remove to true will give correct result: > {code} > 0: jdbc:hive2://localhost:10000/default> set hive.optimize.union.remove; > +-----------------------------------+--+ > | set | > +-----------------------------------+--+ > | hive.optimize.union.remove=false | > +-----------------------------------+--+ > 0: jdbc:hive2://localhost:10000/default> SELECT COUNT(1) FROM test UNION ALL SELECT COUNT(1) FROM test; > +----------+--+ > | _u1._c0 | > +----------+--+ > | 1 | > | 1 | > +----------+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)