Steve Carlin created IMPALA-14811:
-------------------------------------

             Summary: Calcite Planner: Unneeded SelectNode created below 
JoinNode
                 Key: IMPALA-14811
                 URL: https://issues.apache.org/jira/browse/IMPALA-14811
             Project: IMPALA
          Issue Type: Sub-task
            Reporter: Steve Carlin


In bloom_filters.test for the query:

 
{code:java}
with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem)
select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a
    join (select * from l LIMIT 125000) b on a.l_orderkey = -b.l_orderkey;
{code}
...an unnecessary SelectNode is created underneath the Join.

We should create a rule that removes the LogicalFilter under a LogicalJoin if:
a) the join is an inner join
b) There is a filter directly underneath the join
c) the only condition in the filter is an is not null clause
d) the join is either an inner join or, if it's a left/right join, the 
left/right side contains the filter.

 



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

Reply via email to