[ 
https://issues.apache.org/jira/browse/HIVE-7400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14061654#comment-14061654
 ] 

Gopal V commented on HIVE-7400:
-------------------------------

Never mind, laggy JIRA updates. Saw the file now.

> 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)

Reply via email to