Vitalii Diravka created CALCITE-2274:
----------------------------------------
Summary: 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: Vitalii Diravka
Fix For: next
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
(v7.6.3#76005)