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 B7D1C18A8D for ; Fri, 31 Jul 2015 07:16:04 +0000 (UTC) Received: (qmail 39141 invoked by uid 500); 31 Jul 2015 07:16:04 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 39118 invoked by uid 500); 31 Jul 2015 07:16:04 -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 39107 invoked by uid 99); 31 Jul 2015 07:16:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 07:16:04 +0000 Date: Fri, 31 Jul 2015 07:16:04 +0000 (UTC) From: "Matt McCline (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-11410) Join with subquery containing a group by incorrectly returns no 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/HIVE-11410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14648855#comment-14648855 ] Matt McCline commented on HIVE-11410: ------------------------------------- [~nbrenwald] please attach your EXPLAIN plan for the query. And, confirm you are using branch-1.1 > Join with subquery containing a group by incorrectly returns no results > ----------------------------------------------------------------------- > > Key: HIVE-11410 > URL: https://issues.apache.org/jira/browse/HIVE-11410 > Project: Hive > Issue Type: Bug > Components: Hive > Affects Versions: 1.1.0 > Reporter: Nicholas Brenwald > Assignee: Matt McCline > Priority: Minor > Attachments: hive-site.xml > > > Start by creating a table *t* with columns *c1* and *c2* and populate with 1 row of data. For example create table *t* from an existing table which contains at least 1 row of data by running: > {code} > create table t as select 'abc' as c1, 0 as c2 from Y limit 1; > {code} > Table *t* looks like the following: > ||c1||c2|| > |abc|0| > Running the following query then returns zero results. > {code} > SELECT > t1.c1 > FROM > t t1 > JOIN > (SELECT > t2.c1, > MAX(t2.c2) AS c2 > FROM > t t2 > GROUP BY > t2.c1 > ) t3 > ON t1.c2=t3.c2 > {code} > However, we expected to see the following: > ||c1|| > |abc| > The problem seems to relate to the fact that in the subquery, we group by column *c1*, but this is not subsequently used in the join condition. -- This message was sent by Atlassian JIRA (v6.3.4#6332)