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

Calc on the Intersect in target is not being matched

    XMLWordPrintableJSON

    Details

    • Type: Wish
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.22.0
    • Component/s: None

      Description

      @Test public void testIntersectToCalcOnIntersect() {
          final String mv = ""
              + "select \"deptno\",\"name\" from \"emps\"\n"
              + "intersect all\n"
              + "select \"deptno\",\"name\" from \"depts\"";
          String mv1 = "select \"name\", \"deptno\" from (" + mv + ")";
      
          final String query = ""
              + "select \"name\",\"deptno\" from \"depts\"\n"
              + "intersect all\n"
              + "select \"name\",\"deptno\" from \"emps\"";
          checkMaterialize(mv1, query, true);
        }
      

      error:

      java.lang.AssertionError: 
      Expected: a string containing "EnumerableTableScan(table=[[hr, m0]])"
           but: was "PLAN=EnumerableIntersect(all=[true])\n  EnumerableCalc(expr#0..3=[{inputs}], name=[$t1], deptno=[$t0])\n    EnumerableTableScan(table=[[hr, depts]])\n  EnumerableCalc(expr#0..4=[{inputs}], name=[$t2], deptno=[$t1])\n    EnumerableTableScan(table=[[hr, emps]])\n\n"
      <Click to see difference>
      
      
      	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
      	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
      	at org.apache.calcite.test.CalciteAssert.lambda$checkResultContains$7(CalciteAssert.java:429)
      	at org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAssert.java:544)
      	at org.apache.calcite.test.CalciteAssert$AssertQuery.lambda$returns$1(CalciteAssert.java:1514)
      

        Attachments

        1. screenshot-1.png
          127 kB
          xzh_dz
        2. screenshot-2.png
          257 kB
          xzh_dz
        3. screenshot-3.png
          112 kB
          xzh_dz

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                xzh_dz xzh_dz
              • Votes:
                0 Vote for this issue
                Watchers:
                4 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 - 3h
                  3h