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

Wrong results with =ANY subquery

    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

          Issue Links

            Activity

              People

              • Assignee:
                vgarg Vineet Garg
                Reporter:
                vgarg Vineet Garg
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                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