You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Stamatis Zampetakis (JIRA)" <ji...@apache.org> on 2019/04/01 10:15:00 UTC

[jira] [Commented] (CALCITE-2968) New AntiJoin relational expression

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

Stamatis Zampetakis commented on CALCITE-2968:
----------------------------------------------

There has been a discussion on this subject in the dev list. See thread [Join, SemiJoin, Correlate|https://mail-archives.apache.org/mod_mbox/calcite-dev/201903.mbox/%3C8EEA04A0-4A77-4283-BD20-B019E19AE126%40apache.org%3E] which seems to have reached consensus. I think the discussion there supersedes the current proposal so I would prefer to go towards that direction.

> New AntiJoin relational expression
> ----------------------------------
>
>                 Key: CALCITE-2968
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2968
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Ruben Quesada Lopez
>            Priority: Major
>
> The goal of this ticket is to follow the discussion started in CALCITE-2920 (and its [PR|https://github.com/apache/calcite/pull/1110]).
> With the implementation of CALCITE-2920, RelBuilder has now a method to create an AntiJoin. However, since, for the moment, there is no "AntiJoin" expression, the only possibility to build an AntiJoin is using a LogicalCorrelate with SemiJoinType.ANTI, and that's exactly what this method does, for now.
> The idea would be to "generalize" this with the creation of a new AntiJoin (a.k.a. AntiSemiJoin) relational expression.
> Some ideas about how to implement it:
> - Modify SemiJoin class: add a new instance field protected final SemiJoinType semiJoinType;, which will be by default SemiJoinType.SEMI (to ensure backwards compatibility); but that could also be SemiJoinType.ANTI, to represent an AntiJoin (a.k.a. AntiSemiJoin)
> - We could easily have two implementations of Antijoin:
> -- a) Enumerable: small modification in EnumerableSemiJoin and EnumerableSemiJoinRule in order to propagate the SemiJoinType, plus a new antiJoin method in EnumerableDefaults (basically the same as semiJoin method, but with a "not contains" predicate instead of "contains")
> -- b) Correlate: small modification in JoinToCorrelateRule to propagate the SemiJoin.semiJoinType will suffice to create the appropriate LogicalCorrelate with type SEMI / ANTI
> - RelBuilder antiJoin method would no longer create a LogicalCorrelate type=ANTI, but instead a SemiJoin type=ANTI (using a new method in SemiJoinFactory that would accept an additional SemiJoinType parameter).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)