libenchao commented on code in PR #2848:
URL: https://github.com/apache/calcite/pull/2848#discussion_r913754054
##########
core/src/main/java/org/apache/calcite/rel/rules/SemiJoinRule.java:
##########
@@ -42,14 +43,18 @@
/**
* Planner rule that creates a {@code SemiJoin} from a
* {@link org.apache.calcite.rel.core.Join} on top of a
- * {@link org.apache.calcite.rel.logical.LogicalAggregate}.
+ * {@link org.apache.calcite.rel.logical.LogicalAggregate} or
+ * on a {@link org.apache.calcite.rel.RelNode} which is
+ * unique for join's right keys.
*/
public abstract class SemiJoinRule
extends RelRule<SemiJoinRule.Config>
implements TransformationRule {
private static boolean isJoinTypeSupported(Join join) {
final JoinRelType type = join.getJoinType();
- return type == JoinRelType.INNER || type == JoinRelType.LEFT;
+ return type == JoinRelType.INNER
+ || type == JoinRelType.LEFT
+ || type == JoinRelType.SEMI;
}
Review Comment:
I put it in this condition because `JoinToSemiJoinRule` needs it. If it's
already a semi join, we can still removes the `Aggregate` if we could match. In
current implementation, we already considered the semi join case, see
https://github.com/apache/calcite/blob/724eb032d0141c15d17422d50c5235be00ac989f/core/src/main/java/org/apache/calcite/rel/rules/SemiJoinRule.java#L81
and
https://github.com/apache/calcite/blob/724eb032d0141c15d17422d50c5235be00ac989f/core/src/main/java/org/apache/calcite/rel/rules/SemiJoinRule.java#L99
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]