Xuebin Su created IMPALA-15013:
----------------------------------

             Summary: PIVOT returns NULL instead of 0 for count() when no row 
matches the value
                 Key: IMPALA-15013
                 URL: https://issues.apache.org/jira/browse/IMPALA-15013
             Project: IMPALA
          Issue Type: Bug
            Reporter: Xuebin Su
            Assignee: Xuebin Su


The result of the following query is incorrect:
{code:java}
[localhost:21050] default> with t1(a, b) as (
    values (1, null), (2, null)
)
select * from t1 pivot (
    count(a) as c for b in (2 as v2, 4 as v4)
) as t;
+---+------+------+
| a | v2   | v4   |
+---+------+------+
| 1 | NULL | NULL |
| 2 | NULL | NULL |
+---+------+------+
Fetched 2 row(s) in 0.11s {code}
while the expected result is
{code:java}
+---+----+----+
| a | v2 | v4 |
+---+----+----+
| 1 | 0  | 0  |
| 2 | 0  | 0  |
+---+----+----+ {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to