Jackie-Jiang commented on code in PR #14066:
URL: https://github.com/apache/pinot/pull/14066#discussion_r1773739356


##########
pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/rules/PinotAggregateToSemiJoinRule.java:
##########
@@ -50,18 +48,9 @@ public class PinotAggregateToSemiJoinRule extends RelOptRule 
{
       new PinotAggregateToSemiJoinRule(PinotRuleUtils.PINOT_REL_FACTORY);
 
   public PinotAggregateToSemiJoinRule(RelBuilderFactory factory) {
-    super(operand(LogicalAggregate.class, any()), factory, null);
-  }
-
-  @Override
-  @SuppressWarnings("rawtypes")
-  public boolean matches(RelOptRuleCall call) {
-    final Aggregate topAgg = call.rel(0);
-    if (!PinotRuleUtils.isJoin(topAgg.getInput())) {
-      return false;
-    }
-    final Join join = (Join) PinotRuleUtils.unboxRel(topAgg.getInput());
-    return PinotRuleUtils.isAggregate(join.getInput(1));
+    super(operand(Aggregate.class,
+            some(operand(Join.class, some(operand(RelNode.class, any()), 
operand(Aggregate.class, any()))))), factory,
+        null);

Review Comment:
   Yes, I also noticed that. `PinotSortExchangeCopyRule` is also using the 
config in the constructor (I believe the benefit is to allow reusing the same 
rule to match different trees).
   We can use a separate PR to clean this up.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to