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

Materialization-Failed, meeting to pull up bottom filter of Left/Right Join

    XMLWordPrintableJSON

Details

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

    Description

      Hi all.
      `SubstitutionVisitor` support more join_type in some rules of `Join`.
      Now `SubstitutionVisitor` only support join type of `INNER`, when pulling up bottom filters of join.

      It doesn't work as follows.

      @Test public void testJoinOnLeftProjectWithFilterToJoin() {
          String mv = ""
              + "select \"emps\".\"empid\", \"depts\".\"name\", \"emps\".\"salary\"\n" +
              "from \"emps\"\n" +
              "left join \"depts\"\n" +
              "on \"emps\".\"deptno\" = \"depts\".\"deptno\"\n"
              + "where \"emps\".\"empid\" > 10";
          String query = ""
              + "select \"emps\".\"empid\", \"depts\".\"name\", \"emps\".\"salary\"\n" +
              "from \"emps\"\n" +
              "left join \"depts\"\n" +
              "on \"emps\".\"deptno\" = \"depts\".\"deptno\"\n"
              + "where \"emps\".\"empid\" > 40";
          sql(mv, query).withOnlyBySubstitution(true).ok();
        }
      

      Attachments

        1. Jietu20200417-200532.png
          595 kB
          Xurenhe

        Issue Links

          Activity

            People

              wojustme Xurenhe
              wojustme Xurenhe
              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 - 3h 20m
                  3h 20m