[
https://issues.apache.org/jira/browse/CALCITE-3890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17534672#comment-17534672
]
Julian Hyde commented on CALCITE-3890:
--------------------------------------
In the particular case of {{IS NOT DISTINCT FROM}} it is not safe to add {{IS
NOT NULL}} filters. For example, {{Emp e JOIN Dept d ON e.deptno IS NOT
DISTINCT FROM d.deptno}} will return a row where both {{e.deptno}} and
{{d.deptno}} are both null. Hopefully {{Strong}} knows this.
> 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
> Time Spent: 1h
> 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.7#820007)