You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Zou (Jira)" <ji...@apache.org> on 2023/03/09 08:01:00 UTC

[jira] [Commented] (CALCITE-5568) LogicalValues causes decorrelate to fail

    [ https://issues.apache.org/jira/browse/CALCITE-5568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17698234#comment-17698234 ] 

Zou commented on CALCITE-5568:
------------------------------

[~leepb] Could you please add a test to reproduce this case?

> LogicalValues causes decorrelate to fail
> ----------------------------------------
>
>                 Key: CALCITE-5568
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5568
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: libopeng
>            Priority: Major
>
> {code:java}
> LogicalProject(sub_1=[$1])
>   LogicalJoin(condition=[true], joinType=[left])
>     LogicalValues(tuples=[[{ 0 }]])                 <----here
>     LogicalAggregate(group=[{}], agg#0=[SINGLE_VALUE($0)])
>       LogicalAggregate(group=[{}], SUM=[SUM($0)])
>         LogicalProject(aaa=[$2])
>           LogicalCorrelate(correlation=[$cor12], joinType=[left], requiredColumns=[{0, 1}])
>             LogicalAggregate(group=[{0, 1}])
>               LogicalProject(sex=[$14], province=[$5])
>                 LogicalJoin(condition=[=($4, $10)], joinType=[left])
>                   LogicalTableScan(table=[[trip_order]])
>                   LogicalTableScan(table=[[trip_passenger]])
>             LogicalAggregate(group=[{}], agg#0=[SINGLE_VALUE($0)])
>               LogicalAggregate(group=[{}], COUNT=[COUNT()])
>                 LogicalFilter(condition=[AND(OR(AND(IS NULL($cor12.province), IS NULL($5)), IS TRUE(=($cor12.province, $5))), true)])
>                   LogicalJoin(condition=[=($4, $10)], joinType=[inner])
>                     LogicalTableScan(table=[[trip_order]])
>                     LogicalAggregate(group=[{0}])
>                       LogicalProject(id=[$0])
>                         LogicalFilter(condition=[OR(AND(IS NULL($cor12.sex), IS NULL($4)), IS TRUE(=($cor12.sex, $4)))])
>                           LogicalTableScan(table=[[trip_passenger]]){code}
> [https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java#L491] 
> Is this as expected?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)