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

Yu Xu edited comment on CALCITE-2274 at 12/23/25 6:03 AM:
----------------------------------------------------------

Fixed in 
[5c6456d|https://github.com/apache/calcite/commit/5c6456d1f783d057f9027f32aa6c37d664a2a598]

Thank you [~jensen]  and thank you for providing this case [~vitalii] !


was (Author: JIRAUSER307770):
Fixed in 
[5c6456d|https://github.com/apache/calcite/commit/5c6456d1f783d057f9027f32aa6c37d664a2a598]

Thank you [~jensen]  and thank you for providing this case. [~vitalii] !

> Filter predicates aren't inferred while using dynamic star in subquery
> ----------------------------------------------------------------------
>
>                 Key: CALCITE-2274
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2274
>             Project: Calcite
>          Issue Type: Improvement
>    Affects Versions: 1.16.0
>            Reporter: Vitalii Diravka
>            Assignee: Zhen Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.42.0
>
>
> Filter predicates are not inferred (in RelMdPredicates#getPredicates(), for 
> example by using
> JoinPushTransitivePredicatesRule), in case when above LogicalProject has 
> dynamic star.
> Query example:
> {code:java}
> SELECT * FROM sales.emp d JOIN 
> (SELECT * FROM sales.emp WHERE deptno = 4) e 
> ON e.deptno = d.deptno
> {code}
> By using JoinPushTransitivePredicatesRule the expected result is:
> {code:java}
> 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]])
> {code}
> and actual result:
> {code:java}
> LogicalProject(**=[$0])
>   LogicalJoin(condition=[=($16, $7)], joinType=[inner])
>     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
>     LogicalProject(**=[$0])
>       LogicalFilter(condition=[=($7, 4)])
>         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> {code}



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

Reply via email to