libenchao commented on code in PR #2848:
URL: https://github.com/apache/calcite/pull/2848#discussion_r939600845
##########
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:
@chunweilei I figured out another way to do this. In
`JoinOnUniqueToSemiJoinRule`, if we found that right is `Aggregate`, we can
fallback to `ProjectToSemiJoinRule`.
--
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]