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

Julian Hyde commented on CALCITE-3890:
--------------------------------------

The description does not say that the filter is a relational expression, nor 
does it say that the filter is before the join rather than after.

I understand why FULL join is not covered, but could you apply the rule to the 
non-NULL-generating sides of LEFT and RIGHT join? E.g.
{code}Emp e LEFT JOIN Dept d USING (deptno){code}
becomes
{code}(SELECT * FROM Emp WHERE deptno IS NOT NULL) LEFT JOIN Dept d USING 
(deptno){code}

Were you able to use {{Strong}} as I suggested? It should be easy to cover 
cases such as
{code}Emp e JOIN Dept d ON e.deptno > d.deptno{code}
or
{code}Emp e JOIN Dept d ON e.deptno + d.deptno < 10{code}

> Derive IS NOT NULL filter from 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
>          Time Spent: 0.5h
>  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 and b.id is not null.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to