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

Chunwei Lei commented on CALCITE-3890:
--------------------------------------

Thank you for your attention, [~zabetak]. IMHO,  the most important point about 
how to implement this rule is how to avoid applying the rule infinitely, which 
is the big difference between the new rule I added and the one used in Hive.  
To achieve this goal, Hive uses some extra data structures to save the 
generated predicates, while the new rule I added just uses MetadataQuery and 
RexSimplify to see whether the ISNOTNULL predicate is redundant or not. 

> Derive IS NOT NULL filter for the inputs of inner join 
> -------------------------------------------------------
>
>                 Key: CALCITE-3890
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3890
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Chunwei Lei
>            Assignee: Chunwei Lei
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.31.0
>
>          Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> We can infer IS NOT NULL predicate from join which implies some columns may 
> not be null. For instance, 
>  
> {code:java}
> select * from a join b on a.id = b.id;
> {code}
> we can infer a.id is not null/b.id is not null and push down them into the 
> child node of the join. Then it becomes
> {code:java}
> select * from (select* from a where id is null) t1 join (select * from b 
> where id is not null) on t1.id = t2.id;
> {code}
>  
>  



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

Reply via email to