[ https://issues.apache.org/jira/browse/HIVE-7400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14061677#comment-14061677 ]
Danran Lai commented on HIVE-7400: ---------------------------------- ~gopalv : Thank you. Now I see some. But I'm using hive-11 and it's not easy for me to upgrade hive-11 to hive-14 for a variety of reasons. Did you know whether there's a kind of patch based on hive-11 could solve this bug? > 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)