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 E418F11C59 for ; Mon, 14 Jul 2014 09:44:05 +0000 (UTC) Received: (qmail 55800 invoked by uid 500); 14 Jul 2014 09:44:04 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 55728 invoked by uid 500); 14 Jul 2014 09:44:04 -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 55717 invoked by uid 500); 14 Jul 2014 09:44:04 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 55714 invoked by uid 99); 14 Jul 2014 09:44:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 09:44:04 +0000 Date: Mon, 14 Jul 2014 09:44:04 +0000 (UTC) From: "Danran Lai (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (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 Danran Lai created HIVE-7400: -------------------------------- Summary: 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 I have a table in Hive and I want to count unique records and all records. Table looks like: {quote} sid string param map domain string product string {quote} And my query like this: {quote} select domain,product,count(1) as num,count(distinct param['from']) 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? -- This message was sent by Atlassian JIRA (v6.2#6252)