You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vineet Garg (JIRA)" <ji...@apache.org> on 2019/04/08 21:22:00 UTC

[jira] [Updated] (CALCITE-2986) Wrong results with =ANY subquery

     [ https://issues.apache.org/jira/browse/CALCITE-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vineet Garg updated CALCITE-2986:
---------------------------------
    Description: 
ANY/SOME subqueries are rewritten using MAX/MIN and cross-join. This is wrong transformation for {{=ANY}} and {{<>ANY}} (and therefore {{=ALL}} and {{<>ALL}}).

Query
{code:sql}
select * from "scott".emp where empno = any (select empno from "scott".emp);
{code}

Expected output for above query is all rows from {{scott.emp}} but actual is only one row

Test case: e.g. https://github.com/apache/calcite/compare/master...vineetgarg02:CALCITE-2986


  was:ANY/SOME subqueries are rewritten using MAX/MIN and cross-join. This is wrong transformation for {{=ANY}} and {{<>ANY}} (and therefore {{=ALL}} and {{<>ALL}}).


> Wrong results with =ANY subquery
> --------------------------------
>
>                 Key: CALCITE-2986
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2986
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>            Priority: Major
>
> ANY/SOME subqueries are rewritten using MAX/MIN and cross-join. This is wrong transformation for {{=ANY}} and {{<>ANY}} (and therefore {{=ALL}} and {{<>ALL}}).
> Query
> {code:sql}
> select * from "scott".emp where empno = any (select empno from "scott".emp);
> {code}
> Expected output for above query is all rows from {{scott.emp}} but actual is only one row
> Test case: e.g. https://github.com/apache/calcite/compare/master...vineetgarg02:CALCITE-2986



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)