Return-Path: Delivered-To: apmail-hive-dev-archive@www.apache.org Received: (qmail 96193 invoked from network); 7 Oct 2010 19:08:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Oct 2010 19:08:56 -0000 Received: (qmail 88377 invoked by uid 500); 7 Oct 2010 19:08:56 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 88209 invoked by uid 500); 7 Oct 2010 19:08:56 -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 88190 invoked by uid 500); 7 Oct 2010 19:08:56 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 88174 invoked by uid 99); 7 Oct 2010 19:08:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 19:08:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 19:08:55 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o97J8Z9d004595 for ; Thu, 7 Oct 2010 19:08:35 GMT Message-ID: <8814759.29731286478515154.JavaMail.jira@thor> Date: Thu, 7 Oct 2010 15:08:35 -0400 (EDT) From: "Namit Jain (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Commented: (HIVE-474) Support for distinct selection on two or more columns In-Reply-To: <1007389206.1241630790351.JavaMail.jira@brutus> 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-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12919023#action_12919023 ] Namit Jain commented on HIVE-474: --------------------------------- Once HIVE-537 is committed, the general idea is as listed in the example in HIVE-537. Say, the query is: select a, count(distinct b), count(distinct c) from T group by a and the data is: a1 b1 c1 a1 b1 c2 a1 b2 c2 a1 b2 c1 a2 ... Mapper will emit a union type: a1 0:b1 a1 1:c1 a1 0:b1 a1 1:c2 a1 0:b2 a1 1:c2 a1 0:b2 a1 1:c1 Since the sort key is (a, union_tag, (b|c)) The data will come to the reducer in the following order: a1 0:b1 a1 0:b1 a1 0:b2 a1 0:b2 a1 1:c1 a1 1:c1 a1 1:c2 a1 1:c2 and then the reducer can stream the distincts > Support for distinct selection on two or more columns > ----------------------------------------------------- > > Key: HIVE-474 > URL: https://issues.apache.org/jira/browse/HIVE-474 > Project: Hadoop Hive > Issue Type: Improvement > Components: Query Processor > Reporter: Alexis Rondeau > Assignee: Amareshwari Sriramadasu > Attachments: hive-474.0.4.2rc.patch > > > The ability to select distinct several, individual columns as by example: > select count(distinct user), count(distinct session) from actions; > Currently returns the following failure: > FAILED: Error in semantic analysis: line 2:7 DISTINCT on Different Columns not Supported user -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.