Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Wrong calculation result
select *
from dept
where deptno in (
select count(*)
from emp
where comm is null);
+--------+------------+----------+
| DEPTNO | DNAME | LOC |
+--------+------------+----------+
+--------+------------+----------+
Correct calculation results
select * from dept where cast(deptno as bigint) in ( select count(*) from emp where comm is null); +--------+------------+----------+ | DEPTNO | DNAME | LOC | +--------+------------+----------+ | 10 | ACCOUNTING | NEW YORK | +--------+------------+----------+
The above two cases can be reproduced in agg.iq.
Or look at this submission https://github.com/apache/calcite/commit/6cef259f29884fbda3f165d579232285998d1b46.
Attachments
Issue Links
- duplicates
-
CALCITE-5156 Support implicit integer type cast for IN Sub-query
- Resolved
- links to