gortiz commented on code in PR #18387:
URL: https://github.com/apache/pinot/pull/18387#discussion_r3219385783


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/rules/DefaultRuleSetCustomizer.java:
##########
@@ -43,26 +43,44 @@
 import org.apache.calcite.rel.rules.SortJoinTransposeRule;
 import org.apache.calcite.rel.rules.SortRemoveRule;
 import org.apache.calcite.rel.rules.UnionToDistinctRule;
+import org.apache.pinot.calcite.rel.rules.PinotAggregateExchangeNodeInsertRule;
+import org.apache.pinot.calcite.rel.rules.PinotAggregateFunctionRewriteRule;
+import org.apache.pinot.calcite.rel.rules.PinotAggregateReduceFunctionsRule;
+import org.apache.pinot.calcite.rel.rules.PinotEnrichedJoinRule;
+import org.apache.pinot.calcite.rel.rules.PinotEvaluateLiteralRule;
+import org.apache.pinot.calcite.rel.rules.PinotExchangeEliminationRule;
 import 
org.apache.pinot.calcite.rel.rules.PinotFilterJoinRule.PinotFilterIntoJoinRule;
 import 
org.apache.pinot.calcite.rel.rules.PinotFilterJoinRule.PinotJoinConditionPushRule;
+import org.apache.pinot.calcite.rel.rules.PinotJoinExchangeNodeInsertRule;
+import 
org.apache.pinot.calcite.rel.rules.PinotJoinPushTransitivePredicatesRule;
+import org.apache.pinot.calcite.rel.rules.PinotJoinToDynamicBroadcastRule;
+import org.apache.pinot.calcite.rel.rules.PinotLogicalAggregateRule;
+import org.apache.pinot.calcite.rel.rules.PinotProjectJoinTransposeRule;
+import org.apache.pinot.calcite.rel.rules.PinotSemiJoinDistinctProjectRule;
+import org.apache.pinot.calcite.rel.rules.PinotSetOpExchangeNodeInsertRule;
+import org.apache.pinot.calcite.rel.rules.PinotSingleValueAggregateRemoveRule;
+import org.apache.pinot.calcite.rel.rules.PinotSortExchangeCopyRule;
+import org.apache.pinot.calcite.rel.rules.PinotSortExchangeNodeInsertRule;
+import org.apache.pinot.calcite.rel.rules.PinotTableScanConverterRule;
+import org.apache.pinot.calcite.rel.rules.PinotWindowExchangeNodeInsertRule;
+import org.apache.pinot.calcite.rel.rules.PinotWindowSplitRule;
 import org.apache.pinot.spi.utils.CommonConstants.Broker.PlannerRuleNames;
 
 
-/**
- * Default rule sets for Pinot query
- * Defaultly disabled rules are defined in
- * {@link 
org.apache.pinot.spi.utils.CommonConstants.Broker#DEFAULT_DISABLED_RULES}
- *
- * TODO: This class started as a list of constant rule sets, but since then we 
have added dynamic rule generation
- *   to it as well. We should probably refactor the class to make it easier to 
understand, maintain and change the rules
- *   based on contextual information like query options.
- */
-public class PinotQueryRuleSets {
-  private PinotQueryRuleSets() {
-  }
+/// [RuleSetCustomizer] that seeds every [Phase] with the OSS default Calcite
+/// rules for the multi-stage query planner. Registered as a 
[java.util.ServiceLoader]
+/// service entry so it is picked up automatically by [PinotRuleSet].
+///
+/// `POST_LOGICAL` includes `PinotSortExchangeCopyRule.SORT_EXCHANGE_COPY`
+/// configured with the rule's hard-coded default `fetchLimitThreshold`.
+/// Per-query overrides (and broker-config overrides) of that limit are
+/// applied later by `QueryEnvironment.getTraitProgram`, which swaps the
+/// configured `PinotSortExchangeCopyRule` on a per-query copy of the
+/// `POST_LOGICAL` list.
+public final class DefaultRuleSetCustomizer implements RuleSetCustomizer {

Review Comment:
   It should be fixed now



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to