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

Materialized view rewriting not being triggered for some join queries

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.16.0
    • Component/s: 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

            People

            • Assignee:
              jcamachorodriguez Jesus Camacho Rodriguez
              Reporter:
              jcamachorodriguez Jesus Camacho Rodriguez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: