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

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

Does it make any sense to have an inner join after an outer join for _simple 
equality joins_? By doing that, you essentially force inner join semantics on 
the left joins. That's one reason why I only handle plain equality predicates 
of outer joins. I haven't thought too much about a possible problematic 
scenario yet, but I will certainly try. If you come up with a counter example 
before me, please let me know.
It would be very nice if you knew a more general approach to this that might 
even allow rewrites in even more cases, I would really love that. I haven't 
read the paper nor looked into the matching or rewriting algorithm so I'm not 
sure if I am the right person to do anything in there. You seem to already have 
an idea about how to tackle that problem :)
Do I understand you correctly, that the changes in {{getAllPredicates}} are ok 
or at least that the general idea of pulling up the {{OR(ISNULL(),=())}} 
instead of {{=()}} is correct? I'm asking because I'd like to use that method 
to determine the predicates of a table that are essential to it's results. When 
checking these predicates against change sets, one could determine if a data 
change affected the data which is a nice thing to have for materialized views :)

> 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