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 2DB5211300 for ; Tue, 15 Jul 2014 04:54:06 +0000 (UTC) Received: (qmail 35758 invoked by uid 500); 15 Jul 2014 04:54:05 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 35677 invoked by uid 500); 15 Jul 2014 04:54:05 -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 35663 invoked by uid 500); 15 Jul 2014 04:54:05 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 35660 invoked by uid 99); 15 Jul 2014 04:54:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jul 2014 04:54:05 +0000 Date: Tue, 15 Jul 2014 04:54:05 +0000 (UTC) From: "Gopal V (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-7400) count and count distinct not correct 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-7400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14061662#comment-14061662 ] Gopal V commented on HIVE-7400: ------------------------------- With Tez enabled, I cannot reproduce this {code} Status: Finished successfully OK domain1 product1 150000 36424 Time taken: 6.389 seconds, Fetched: 1 row(s) hive> {code} > count and count distinct not correct > ------------------------------------ > > Key: HIVE-7400 > URL: https://issues.apache.org/jira/browse/HIVE-7400 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 0.11.0 > Reporter: Danran Lai > Attachments: data_150000 > > > I have a table in Hive and I want to count unique records and all records. > Table looks like: > {quote} > sid string > sender string > domain string > product string > {quote} > And my query like this: > {quote} > select domain,product,count(1) as num,count(distinct sender) as user_num > from table > group by domain,product > {quote} > But the results are not correct. I can get the right user_num, but the num is wrong which is less than the real num. The real num is about 30 millon but I can only get 9 millon. > So how can I fix this so that I get the correct result? > ==================Updated========================== > Dataset is uploaded. Row format delimited fields terminated by '\t'. This dataset has 150,000 rows. With this query, I got the result as followed: > bq.domain1 product1 36424 36424 -- This message was sent by Atlassian JIRA (v6.2#6252)