XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • 1.22.0
    • core

    Description

      With current implementation of MV matching, below case fails

        @Test public void testFilterOnProject() {
          String deduplicated =
              "(select \"empid\", \"deptno\", \"name\", \"salary\", \"commission\"\n"
                  + "from \"emps\"\n"
                  + "group by \"empid\", \"deptno\", \"name\", \"salary\", \"commission\")";
          String mv =
              "select * from\n"
                  + "(select \"deptno\", sum(\"salary\") as \"sum_salary\", sum(\"commission\")\n"
                  + "from " + deduplicated + "\n"
                  + "group by \"deptno\")\n"
                  + "where \"sum_salary\" > 10";
          String query =
              "select * from\n"
                  + "(select \"deptno\", sum(\"salary\") as \"sum_salary\"\n"
                  + "from " + deduplicated + "\n"
                  + "group by \"deptno\")\n"
                  + "where \"sum_salary\" > 10";
          checkMaterialize(mv, query);
        }
      

      Reason:
      After matching of the Aggregates, a compensating Project is added, but afterwards matching of filter fails to handle it.
      This issue proposes to handle such case where query and target are Filters and query has a compensating Project child node

      Attachments

        Issue Links

          Activity

            People

              jinxing6042@126.com Jin Xing
              jinxing6042@126.com Jin Xing
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 40m
                  40m