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. With the implementation of
CALCITE-2969 (re-design of join-like expressions), it seems clear that the new AntiJoin expression will be a LogicalJoin with JoinType=ANTI. Also, it will have to be verified that:
- this new AntiJoin works fine in EnumerableConvention with all types of join condition (equi-join, partial equi-join, non equi-join)
- this new AntiJoin can be correctly transformed into a Correlate (type ANTI) via JoinToCorrelateRule