You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2023/01/18 19:11:33 UTC
[GitHub] [pinot] walterddr commented on a diff in pull request #10122: [multistage] Push Down Project for Aggregation With No Grouping Sets
walterddr commented on code in PR #10122:
URL: https://github.com/apache/pinot/pull/10122#discussion_r1073965486
##########
pinot-query-planner/src/main/java/org/apache/calcite/rel/rules/PinotRuleUtils.java:
##########
@@ -23,22 +23,28 @@
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.core.Exchange;
import org.apache.calcite.rel.core.RelFactories;
+import org.apache.calcite.rel.logical.LogicalAggregate;
+import org.apache.calcite.rel.logical.LogicalJoin;
import org.apache.calcite.tools.RelBuilder;
import org.apache.calcite.tools.RelBuilderFactory;
-public class PinotRuleUtils {
+class PinotRuleUtils {
private static final RelBuilder.Config DEFAULT_CONFIG =
RelBuilder.Config.DEFAULT.withAggregateUnique(true).withPushJoinCondition(true);
- public static final RelBuilderFactory PINOT_REL_FACTORY =
+ static final RelBuilderFactory PINOT_REL_FACTORY =
RelBuilder.proto(Contexts.of(RelFactories.DEFAULT_STRUCT, DEFAULT_CONFIG));
+ // A AggregateExtractProjectRule configured to run when a LogicalAggregate sits atop a LogicalJoin.
+ static final AggregateExtractProjectRule PINOT_AGGREGATE_EXTRACT_PROJECT_RULE =
+ new AggregateExtractProjectRule(LogicalAggregate.class, LogicalJoin.class, PinotRuleUtils.PINOT_REL_FACTORY);
Review Comment:
```suggestion
static final AggregateExtractProjectRule PINOT_AGGREGATE_EXTRACT_PROJECT_RULE =
new AggregateExtractProjectRule(ImmutableAggregateExtractProjectRule.Config.of()
.withOperandSupplier(b0 -> b0.operand(Aggregate.class).oneInput(
b1 -> b1.operand(RelNode.class).predicate(r -> !(r instanceof Project)).anyInputs()))
.withRelBuilderFactory(PINOT_REL_FACTORY));
```
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org