Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2986

Wrong results with =ANY subquery

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      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

      select * from "scott".emp where empno = any (select empno from "scott".emp);
      

      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

        Attachments

          Activity

            People

            • Assignee:
              vgarg Vineet Garg
              Reporter:
              vgarg Vineet Garg

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 20m
                2h 20m

                  Issue deployment