hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Shelukhin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-5658) count(distinct) produces confusing results for null
Date Sat, 26 Oct 2013 01:38:31 GMT

     [ https://issues.apache.org/jira/browse/HIVE-5658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Shelukhin updated HIVE-5658:
-----------------------------------

    Description: 
{code}
select csmallint, count(distinct(csmallint)) from alltypesorc group by csmallint limit 3;
{code}
produces:
{noformat}
NULL	0
-16379	1
-16373	1
{noformat}

There are records in table with NULL values; however the count in this case should be 1, not
0, it seems. This is with TopN disabled, so it is unrelated to the other bug

  was:
{code}
select csmallint, count(distinct(csmallint)) from alltypesorc group by csmallint limit 3;
{code}
produces:
{noformat}
NULL	0
-16379	1
-16373	1
{noformat}

There are records in table with NULL values; however the count in this case should be 1, not
0, it seems


> count(distinct) produces confusing results for null
> ---------------------------------------------------
>
>                 Key: HIVE-5658
>                 URL: https://issues.apache.org/jira/browse/HIVE-5658
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>
> {code}
> select csmallint, count(distinct(csmallint)) from alltypesorc group by csmallint limit
3;
> {code}
> produces:
> {noformat}
> NULL	0
> -16379	1
> -16373	1
> {noformat}
> There are records in table with NULL values; however the count in this case should be
1, not 0, it seems. This is with TopN disabled, so it is unrelated to the other bug



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message