rubenada commented on code in PR #2848:
URL: https://github.com/apache/calcite/pull/2848#discussion_r913797879
##########
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:
Not sure about this... can we have a SEMI with an aggregate inside in a real
scenario?
The code that you mention seems to be "legacy code" that we forgot to
clean-up when CALCITE-4623 was applied. In practice, the existing
`JoinToSemiJoinRule` should not match SEMI because it is not included on its
`isJoinTypeSupported` method (which was changed via CALCITE-4623 to consider
just INNER and LEFT):
```
private static boolean isJoinTypeSupported(Join join) {
final JoinRelType type = join.getJoinType();
return type == JoinRelType.INNER || type == JoinRelType.LEFT;
}
```
--
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]