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

Stamatis Zampetakis commented on CALCITE-3890:
----------------------------------------------

Hey [~Chunwei Lei] , I didn't notice that this Jira was resolved, thats great! 
I see that there was a discussion before to take inspiration from 
[HiveJoinAddNotNullRule|https://github.com/apache/hive/blob/1c3406ea598e0c2d866b20747602c1a01fa5a425/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java]
 . Can you clarify the similarities/differences (if any) between the new rule 
that you added and the one used in Hive. I am asking cause ideally I would like 
to avoid maintaining the same code in multiple places.

> 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