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 32A8818B51 for ; Sat, 5 Mar 2016 16:12:41 +0000 (UTC) Received: (qmail 18630 invoked by uid 500); 5 Mar 2016 16:12:41 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 18607 invoked by uid 500); 5 Mar 2016 16:12:41 -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 18598 invoked by uid 99); 5 Mar 2016 16:12:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2016 16:12:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C6B342C1F56 for ; Sat, 5 Mar 2016 16:12:40 +0000 (UTC) Date: Sat, 5 Mar 2016 16:12:40 +0000 (UTC) From: "Yongzhi Chen (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-13200) Aggregation functions returning empty rows on partitioned columns 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-13200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yongzhi Chen updated HIVE-13200: -------------------------------- Resolution: Fixed Fix Version/s: 2.1.0 1.3.0 Status: Resolved (was: Patch Available) Thanks [~sershe] for reviewing the code. The fix is committed to master and branch-1 > Aggregation functions returning empty rows on partitioned columns > ----------------------------------------------------------------- > > Key: HIVE-13200 > URL: https://issues.apache.org/jira/browse/HIVE-13200 > Project: Hive > Issue Type: Bug > Components: Physical Optimizer > Affects Versions: 1.0.0, 2.0.0 > Reporter: Yongzhi Chen > Assignee: Yongzhi Chen > Fix For: 1.3.0, 2.1.0 > > Attachments: HIVE-13200.1.patch > > > Running aggregation functions like MAX, MIN, DISTINCT against partitioned columns will return empty rows if table has property: 'skip.header.line.count'='1' > Reproduce: > {noformat} > DROP TABLE IF EXISTS test; > CREATE TABLE test (a int) > PARTITIONED BY (b int) > ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' > TBLPROPERTIES('skip.header.line.count'='1'); > INSERT OVERWRITE TABLE test PARTITION (b = 1) VALUES (1), (2), (3), (4); > INSERT OVERWRITE TABLE test PARTITION (b = 2) VALUES (1), (2), (3), (4); > SELECT * FROM test; > SELECT DISTINCT b FROM test; > SELECT MAX(b) FROM test; > SELECT DISTINCT a FROM test; > {noformat} > The output: > {noformat} > 0: jdbc:hive2://localhost:10000/default> SELECT * FROM test; > +---------+---------+--+ > | test.a | test.b | > +---------+---------+--+ > | 2 | 1 | > | 3 | 1 | > | 4 | 1 | > | 2 | 2 | > | 3 | 2 | > | 4 | 2 | > +---------+---------+--+ > 6 rows selected (0.631 seconds) > 0: jdbc:hive2://localhost:10000/default> SELECT DISTINCT b FROM test; > +----+--+ > | b | > +----+--+ > +----+--+ > No rows selected (47.229 seconds) > 0: jdbc:hive2://localhost:10000/default> SELECT MAX(b) FROM test; > +-------+--+ > | _c0 | > +-------+--+ > | NULL | > +-------+--+ > 1 row selected (49.508 seconds) > 0: jdbc:hive2://localhost:10000/default> SELECT DISTINCT a FROM test; > +----+--+ > | a | > +----+--+ > | 2 | > | 3 | > | 4 | > +----+--+ > 3 rows selected (46.859 seconds) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)