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

Materialized view rewriting not being triggered for some join queries

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

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.16.0
    • core

    Description

      The issue has to do with the column equivalences mapping for joins with equality predicates for columns that are output by the query or subquery (basically, there is a bug and we do not apply mapping). This results in missing rewriting opportunities as the top expression cannot be mapped from the query to the view. It can be reproduced with the following MV and query in MaterializationTest.java:

      MV:

      select *
      from "emps"
      join "dependents" using ("empid");
      

      Query:

      select "emps"."empid", "dependents"."empid", "emps"."deptno"
      from "emps"
      join "dependents" using ("empid")
      join "depts" "a" on ("emps"."deptno"="a"."deptno")
      where "emps"."name" = 'Bill';
      

      Attachments

        Activity

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

          People

            jcamacho Jesús Camacho Rodríguez
            jcamacho Jesús Camacho Rodríguez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment