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

When predicate conditions are equivalent, materialized view recognition fails.

Rank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersConvert to sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.28.0
    • None

    Description

      // code placeholder
      org.apache.calcite.test.MaterializedViewSubstitutionVisitorTest
      @Test void testRexCondition() {
        final String mv = ""
            + "select \"name\"\n"
            + "from \"emps\"\n"
            + "where \"deptno\" > 100 and \"deptno\" > 50\n"
            + "group by \"name\"";
        final String query = ""
            + "select \"name\"\n"
            + "from \"emps\"\n"
            + "where \"deptno\" > 100"
            + "group by \"name\"";
        sql(mv, query).withChecker(
            resultContains(""
                + "EnumerableTableScan(table=[[hr, MV0]])")).ok();
      }
      

      Materialized view failed to be matched by optimized results:Materialized view failed to be matched by optimized results: java.lang.AssertionError: Materialized view failed to be matched by optimized results: at org.apache.calcite.test.AbstractMaterializedViewTest.checkMaterialize(AbstractMaterializedViewTest.java:116) at org.apache.calcite.test.AbstractMaterializedViewTest.access$000(AbstractMaterializedViewTest.java:67) at org.apache.calcite.test.AbstractMaterializedViewTest$Sql.ok(AbstractMaterializedViewTest.java:229)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            xzh_dz xzh_dz
            Votes:
            0 Vote for this issue
            Watchers:
            5 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 - 0.5h
                0.5h

                Slack

                  Issue deployment