You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "xiong duan (Jira)" <ji...@apache.org> on 2024/06/06 00:47:00 UTC
[jira] [Commented] (CALCITE-5930) When sqlToRel is converted from in to join, condition '=' on both sides will have inconsistent data types.
[ https://issues.apache.org/jira/browse/CALCITE-5930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852607#comment-17852607 ]
xiong duan commented on CALCITE-5930:
-------------------------------------
The PR for CALCITE-5156 is ready, Welcome to review https://github.com/apache/calcite/pull/2811
> When sqlToRel is converted from in to join, condition '=' on both sides will have inconsistent data types.
> ----------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-5930
> URL: https://issues.apache.org/jira/browse/CALCITE-5930
> Project: Calcite
> Issue Type: Bug
> Reporter: libopeng
> Priority: Major
> Labels: pull-request-available
>
> 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.
> Or look at this submission [https://github.com/apache/calcite/commit/6cef259f29884fbda3f165d579232285998d1b46].
>
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)