[ https://issues.apache.org/jira/browse/CALCITE-5930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
libopeng updated CALCITE-5930: ------------------------------ Description: Wrong calculation result {code:java} select * from dept where deptno in ( select count(*) from emp where comm is null); +--------+------------+----------+ | DEPTNO | DNAME | LOC | +--------+------------+----------+ +--------+------------+----------+ {code} Correct calculation results {code:java} select * from dept where cast(deptno as bigint) in ( select count(*) from emp where comm is null); +--------+------------+----------+ | DEPTNO | DNAME | LOC | +--------+------------+----------+ | 10 | ACCOUNTING | NEW YORK | +--------+------------+----------+{code} The above two cases can be reproduced in agg.iq. was: {code:java} select * from dept where deptno in ( select count(*) from emp where comm is null); +--------+------------+----------+ | DEPTNO | DNAME | LOC | +--------+------------+----------+ +--------+------------+----------+ {code} {code:java} select * from dept where cast(deptno as bigint) in ( select count(*) from emp where comm is null); +--------+------------+----------+ | DEPTNO | DNAME | LOC | +--------+------------+----------+ | 10 | ACCOUNTING | NEW YORK | +--------+------------+----------+{code} > When data types do not match, calcite may make a calculation error > ------------------------------------------------------------------ > > Key: CALCITE-5930 > URL: https://issues.apache.org/jira/browse/CALCITE-5930 > Project: Calcite > Issue Type: Bug > Reporter: libopeng > Priority: Major > > Wrong calculation result > {code:java} > select * > from dept > where deptno in ( > select count(*) > from emp > where comm is null); > +--------+------------+----------+ > | DEPTNO | DNAME | LOC | > +--------+------------+----------+ > +--------+------------+----------+ {code} > Correct calculation results > {code:java} > select * > from dept > where cast(deptno as bigint) in ( > select count(*) > from emp > where comm is null); > +--------+------------+----------+ > | DEPTNO | DNAME | LOC | > +--------+------------+----------+ > | 10 | ACCOUNTING | NEW YORK | > +--------+------------+----------+{code} > The above two cases can be reproduced in agg.iq. > -- This message was sent by Atlassian Jira (v8.20.10#820010)