Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7DB19105D8 for ; Fri, 16 Jan 2015 18:21:36 +0000 (UTC) Received: (qmail 80539 invoked by uid 500); 16 Jan 2015 18:21:37 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 80440 invoked by uid 500); 16 Jan 2015 18:21:37 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 80294 invoked by uid 500); 16 Jan 2015 18:21:37 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 80270 invoked by uid 99); 16 Jan 2015 18:21:37 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jan 2015 18:21:37 +0000 Date: Fri, 16 Jan 2015 18:21:37 +0000 (UTC) From: "Ashutosh Chauhan (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-9347) Bug with max() together with rank() and grouping sets 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-9347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ashutosh Chauhan updated HIVE-9347: ----------------------------------- Component/s: Query Processor > Bug with max() together with rank() and grouping sets > ----------------------------------------------------- > > Key: HIVE-9347 > URL: https://issues.apache.org/jira/browse/HIVE-9347 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 0.13.1 > Environment: Amazon Elastic Map Reduce, AMI 3.3.1, Hadoop Amazon 2.4.0, Hive 0.13.1 > Reporter: Michal Krawczyk > Assignee: Navis > Attachments: HIVE-9347.1.patch.txt > > > It looks like the query below returns incorrect results on Hive 0.13.1, but it was working fine on Hive 0.11. > I have the following table: > CREATE TABLE `t`( > `category` int, > `live` int, > `comments` int) > with the following data: > hive> select * from t; > OK > 3 0 2 > 2 0 2 > 8 0 2 > The query: > hive> select category, max(live) live, max(comments) comments, rank() OVER (PARTITION BY category ORDER BY comments) rank1 > FROM t > GROUP BY category > GROUPING SETS ((), (category)) > HAVING max(comments) > 0; > return the following results: > NULL 1 48 1 > 2 1 49 1 > 3 1 49 1 > 8 1 49 1 > When using grouping sets with the rank() function the max() function return incorrect results. Everything works fine if I remove grouping sets clause and split the query into two independent queries or remove the rank() function. > This looks like a bug to me but please review. That said, I'm not sure if it's just Amazon issue or general Hive issue. -- This message was sent by Atlassian JIRA (v6.3.4#6332)