[
https://issues.apache.org/jira/browse/CALCITE-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16140654#comment-16140654
]
Jesus Camacho Rodriguez commented on CALCITE-1965:
--------------------------------------------------
The idea when I implemented the lineage was to obtain the origin table columns
for a given expression. The problem that I see with bypassing OUTER joins is
that conceptually the value for that column will not be generated from the
source column (or expression) over a given table, but it can be generated at
that OUTER join operator too. Another example would be aggregation functions in
Aggregate operators.
However, it might be that your extension with the nullable input refs would
work as a proper solution for this... Let me go through the code once again.
About the rewriting algorithm, in the meantime could you try something like:
{code}
View:
select A.a, B.b, C.c from A left outer join B ON (A.a = B.b) inner join C ON
(B.b = C.c);
Query:
select A.a, B.b, C.c from A inner join B ON (A.a = B.b) left outer join C ON
(A.a = C.c);
{code}
In this case, rewriting should not be triggered. Could you check it is the
case? (We need to check whether the rule is producing a TS operation over the
MV).
> 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)