[ https://issues.apache.org/jira/browse/CALCITE-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17743523#comment-17743523 ]
LakeShen edited comment on CALCITE-5847 at 7/16/23 12:37 PM: ------------------------------------------------------------- Hi [~libenchao] , I tested it with CALCITE-5568's PR code,after the RelDecorrelator.decorrelateQuery method,LogicalCorrelate still exist. I think that they shouldn't be the same problem. was (Author: shenlang): Hi [~libenchao] , I testes it with CALCITE-5568's PR code,after the RelDecorrelator.decorrelateQuery method,LogicalCorrelate still exist. I think that they shouldn't be the same problem. > The sql which has Values and CROSS JOIN unnest,after the > RelDecorrelator.decorrelateQuery method,LogicalCorrelate still exist > ----------------------------------------------------------------------------------------------------------------------------- > > Key: CALCITE-5847 > URL: https://issues.apache.org/jira/browse/CALCITE-5847 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.34.0 > Reporter: LakeShen > Priority: Major > > The Sql is : > {code:java} > SELECT val FROM (SELECT DISTINCT vals FROM (values (array[2])) t(vals) WHERE > false) tmp CROSS JOIN unnest(tmp.vals) tt(val) {code} > Before the RelDecorrelator.decorrelateQuery method,the sql plan above is: > {code:java} > 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 }]]) {code} > After the RelDecorrelator.decorrelateQuery method,the sql plan above is: > {code:java} > 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 }]]){code} > LogicalCorrelate has not been eliminated > > -- This message was sent by Atlassian Jira (v8.20.10#820010)