Etienne Pelissier created CALCITE-7944:
------------------------------------------

             Summary: ProjectAggregateMergeRule uses incorrect column ordinals 
for SUM0
                 Key: CALCITE-7944
                 URL: https://issues.apache.org/jira/browse/CALCITE-7944
             Project: Calcite
          Issue Type: Bug
          Components: core
            Reporter: Etienne Pelissier


Broken Quidem test:
{code}
select deptno, coalesce(sum(cast(mgr as int)), 0) as m
from emp
group by deptno
order by deptno;
+--------+-------+
| DEPTNO | M     |
+--------+-------+
|     10 | 15621 |
|     20 | 38661 |
|     30 | 46329 |
+--------+-------+
(3 rows)
{code}

Failure: nullability type mismatch, INTEGER NOT NULL expected but INTEGER 
supplied.

The fix is a one line change in ProjectAggregateMergeRule.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to