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

Filter predicates aren't inferred while using dynamic star in subquery

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.16.0
    • None
    • None
    • None

    Description

      Filter predicates are not inferred (in RelMdPredicates#getPredicates(), for example by using

      JoinPushTransitivePredicatesRule), in case when above LogicalProject has dynamic star.

      Query example:

      SELECT * FROM sales.emp d JOIN 
      (SELECT * FROM sales.emp WHERE deptno = 4) e 
      ON e.deptno = d.deptno
      

      By using JoinPushTransitivePredicatesRule the expected result is:

      LogicalProject(**=[$0])
        LogicalJoin(condition=[=($16, $7)], joinType=[inner])
          LogicalFilter(condition=[=($7, 4)])
            LogicalTableScan(table=[[CATALOG, SALES, EMP]])
          LogicalProject(**=[$0])
            LogicalFilter(condition=[=($7, 4)])
              LogicalTableScan(table=[[CATALOG, SALES, EMP]])
      

      and actual result:

      LogicalProject(**=[$0])
        LogicalJoin(condition=[=($16, $7)], joinType=[inner])
          LogicalTableScan(table=[[CATALOG, SALES, EMP]])
          LogicalProject(**=[$0])
            LogicalFilter(condition=[=($7, 4)])
              LogicalTableScan(table=[[CATALOG, SALES, EMP]])
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vitalii Vitalii Diravka
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: