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

The sql which has Values and CROSS JOIN unnest,after the RelDecorrelator.decorrelateQuery method,LogicalCorrelate still exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.34.0
    • None
    • core
    • None

    Description

      The Sql is :

      SELECT val FROM (SELECT DISTINCT vals FROM (values (array[2])) t(vals) WHERE false) tmp CROSS JOIN unnest(tmp.vals) tt(val) 

      Before the  RelDecorrelator.decorrelateQuery method,the sql plan above is:

      LogicalProject(val=[$1])
        LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
          LogicalProject(vals=[$0])
            LogicalFilter(condition=[false])
              LogicalProject(vals=[ARRAY(2)])
                LogicalValues(tuples=[[{ 0 }]])
          LogicalProject(val=[$0])
            Uncollect
              LogicalProject(vals=[$cor0.vals])
                LogicalValues(tuples=[[{ 0 }]]) 

      After the  RelDecorrelator.decorrelateQuery method,the sql plan above is:

      LogicalProject(val=[$1])
        LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
          LogicalProject(vals=[$0])
            LogicalProject(vals=[ARRAY(2)])
              LogicalFilter(condition=[false])
                LogicalValues(tuples=[[{ 0 }]])
          LogicalProject(val=[$0])
            Uncollect
              LogicalProject(vals=[$cor0.vals])
                LogicalValues(tuples=[[{ 0 }]])

      LogicalCorrelate has not been eliminated

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            shenlang LakeShen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: