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

Julian Hyde commented on PHOENIX-3054:
--------------------------------------

Right. The behavior is as if there is one group that contains zero rows. The 
count of zero rows is 0. The sum, min and max of zero rows is null. It occurs 
if you read from an empty table, or the WHERE clause removes all rows. But if 
the rows are removed after aggregation (HAVING or LIMIT) then the query returns 
0 rows.

> Counting zero null rows returns an empty result set
> ---------------------------------------------------
>
>                 Key: PHOENIX-3054
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3054
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>            Reporter: Kevin Liew
>            Assignee: Ankit Singhal
>            Priority: Minor
>              Labels: count, count(*), null, sql
>             Fix For: 4.8.1
>
>         Attachments: PHOENIX-3054.patch
>
>
> Execute the following query on a table with zero null cells.
> {code}
> select count(*) from table where column1 = null
> {code}
> The result set should consist of one cell with the value `0` but the result 
> set is empty.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to