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

The FilterToCalcRule/ProjectToCalcRule should not convert a Filter/Project to Calc when it contains Subquery

    XMLWordPrintableJSON

Details

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

    Description

       The unit test in RelOptRulesTest:

      @Test void testFilterToCalc() {
        final String sql = "select ename from emp where sal > all (select comm from emp)";
        sql(sql)
            .withRule(CoreRules.FILTER_TO_CALC)
            .checkUnchanged();
      } 

      Now the Calcite's SubQueryRemoveRule includes FILTER_SUB_QUERY_TO_CORRELATE、
      PROJECT_SUB_QUERY_TO_CORRELATE、JOIN_SUB_QUERY_TO_CORRELATE. 
      It doesn't have a CALC_SUB_QUERY_TO_CORRELATE. When the plan has CALC with Subquery, then it can't be converted.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nobigo xiong duan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: