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

Christian Beikov commented on CALCITE-1965:
-------------------------------------------

The impl in {{getAllPredicates}} depends on the change in the lineage code, so 
I am not sure I can apply that independently.
Maybe you can explain the expected lineage concept to me so that I understand 
why this might be problematic? I must know the _lineage_ in the outer join case 
of {{getAllPredicates}} since I have to add {{ISNULL}} predicates for all 
expressions. I guess if I don't add these predicates, the joins would really be 
treated like a inner join and rewrites would happen where they shouldn't.
I thought really hard and even enumerated the scenarios for 4 relations with 
alternating join types and a materialization covering 2 relations, but couldn't 
find a correctnes violation of my approach, of course assuming I have the 
correct understand of the rewriting that is happening. Maybe you can enlighten 
me? :)

As always, time problems. Know them very good :D
Thanks in advance for all the assistance! Looking forward to see the outer join 
support for MVs in master.

> Support outer joins for materialized views
> ------------------------------------------
>
>                 Key: CALCITE-1965
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1965
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Christian Beikov
>            Assignee: Julian Hyde
>
> Currently, only inner joins are supported for materialized view 
> substitutions. The support for outer joins involves creating new pulled up 
> predicates in case of outer joins that represent semantics of the join. For a 
> join predicate like "a.id = b.id" the inner join just pulls up that 
> predicate. When having a left join like e.g. {{select * from a left join b on 
> a.id = b.id}}, the actual pulled up predicate would be {{OR(=(a.id, 
> b.id),ISNULL(b.id))}}. For a right join it would be  {{OR(=(a.id, 
> b.id),ISNULL(a.id))}} and for a full outer join it would be  {{OR(=(a.id, 
> b.id),ISNULL(a.id),ISNULL(b.id))}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to