This is an automated email from the ASF dual-hosted git repository.

yashmayya pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 5985b69eacf Split pinot.broker.mse.planner.disabled.rules on commas 
when set via cluster config (#19642)
5985b69eacf is described below

commit 5985b69eacf7e233a6b42112ccd6907806b88488
Author: Yash Mayya <[email protected]>
AuthorDate: Fri Sep 25 11:48:30 2026 -0700

    Split pinot.broker.mse.planner.disabled.rules on commas when set via 
cluster config (#19642)
---
 .../MultiStageBrokerRequestHandler.java            | 17 +++++++++++++----
 .../MultiStageBrokerRequestHandlerTest.java        | 22 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 4 deletions(-)

diff --git 
a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
 
b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
index 8c70b5cd539..73d348dc437 100644
--- 
a/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
+++ 
b/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java
@@ -229,10 +229,7 @@ public class MultiStageBrokerRequestHandler extends 
BaseBrokerRequestHandler {
         Executors.newFixedThreadPool(
             Math.max(1, Runtime.getRuntime().availableProcessors() / 2),
             new NamedThreadFactory("multi-stage-query-compile-executor")));
-    _defaultDisabledPlannerRules =
-        
_config.containsKey(CommonConstants.Broker.CONFIG_OF_BROKER_MSE_PLANNER_DISABLED_RULES)
 ? Set.copyOf(
-            
_config.getProperty(CommonConstants.Broker.CONFIG_OF_BROKER_MSE_PLANNER_DISABLED_RULES,
 List.of()))
-            : CommonConstants.Broker.DEFAULT_DISABLED_RULES;
+    _defaultDisabledPlannerRules = getDefaultDisabledPlannerRules(_config);
     boolean fingerprintingConfigured = _config.getProperty(
         CommonConstants.Broker.CONFIG_OF_BROKER_ENABLE_QUERY_FINGERPRINTING,
         CommonConstants.Broker.DEFAULT_BROKER_ENABLE_QUERY_FINGERPRINTING);
@@ -257,6 +254,18 @@ public class MultiStageBrokerRequestHandler extends 
BaseBrokerRequestHandler {
         streamingDistinctFlushThreshold > 0 ? 
Integer.toString(streamingDistinctFlushThreshold) : null;
   }
 
+  /// Returns the planner rules disabled by default: the comma-separated list 
in
+  /// [CommonConstants.Broker#CONFIG_OF_BROKER_MSE_PLANNER_DISABLED_RULES], or
+  /// [CommonConstants.Broker#DEFAULT_DISABLED_RULES] when the config is not 
set. An empty value disables no rules.
+  @VisibleForTesting
+  static Set<String> getDefaultDisabledPlannerRules(PinotConfiguration config) 
{
+    if 
(!config.containsKey(CommonConstants.Broker.CONFIG_OF_BROKER_MSE_PLANNER_DISABLED_RULES))
 {
+      return CommonConstants.Broker.DEFAULT_DISABLED_RULES;
+    }
+    return Set.copyOf(
+        
config.getCommaSeparatedList(CommonConstants.Broker.CONFIG_OF_BROKER_MSE_PLANNER_DISABLED_RULES,
 List.of()));
+  }
+
   @Override
   public void start() {
     _queryDispatcher.start();
diff --git 
a/pinot-broker/src/test/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandlerTest.java
 
b/pinot-broker/src/test/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandlerTest.java
index e04423ccf31..fc36e0cf2cb 100644
--- 
a/pinot-broker/src/test/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandlerTest.java
+++ 
b/pinot-broker/src/test/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandlerTest.java
@@ -50,6 +50,7 @@ import 
org.apache.pinot.spi.eventlistener.query.BrokerQueryEventListenerFactory;
 import org.apache.pinot.spi.query.QueryThreadContext;
 import org.apache.pinot.spi.trace.RequestContext;
 import org.apache.pinot.spi.utils.CommonConstants;
+import org.apache.pinot.spi.utils.CommonConstants.Broker.PlannerRuleNames;
 import 
org.apache.pinot.spi.utils.CommonConstants.Broker.Request.QueryOptionKey;
 import org.apache.pinot.spi.utils.CommonConstants.MultiStageQueryRunner;
 import org.apache.pinot.spi.utils.NetUtils;
@@ -209,6 +210,27 @@ public class MultiStageBrokerRequestHandlerTest extends 
QueryEnvironmentTestBase
         "No option should be injected when the broker default is unset");
   }
 
+  @Test
+  public void testDefaultDisabledPlannerRulesFromClusterConfig() {
+    // ServiceStartableUtils.applyClusterConfig applies cluster configs with 
setProperty, which doesn't split lists
+    PinotConfiguration config = new PinotConfiguration();
+    
config.setProperty(CommonConstants.Broker.CONFIG_OF_BROKER_MSE_PLANNER_DISABLED_RULES,
+        "SortJoinCopy, AggregateUnionAggregate,");
+    
assertEquals(MultiStageBrokerRequestHandler.getDefaultDisabledPlannerRules(config),
+        Set.of(PlannerRuleNames.SORT_JOIN_COPY, 
PlannerRuleNames.AGGREGATE_UNION_AGGREGATE));
+  }
+
+  @Test
+  public void testDefaultDisabledPlannerRulesUnsetOrEmpty() {
+    
assertEquals(MultiStageBrokerRequestHandler.getDefaultDisabledPlannerRules(new 
PinotConfiguration()),
+        CommonConstants.Broker.DEFAULT_DISABLED_RULES);
+
+    // An empty value disables no rules instead of falling back to the defaults
+    PinotConfiguration config = new PinotConfiguration();
+    
config.setProperty(CommonConstants.Broker.CONFIG_OF_BROKER_MSE_PLANNER_DISABLED_RULES,
 "");
+    
assertEquals(MultiStageBrokerRequestHandler.getDefaultDisabledPlannerRules(config),
 Set.of());
+  }
+
   private static MultiStageBrokerRequestHandler 
newHandlerWithStreamingGroupByFlushThreshold(
       @Nullable String streamingGroupByFlushThreshold)
       throws Exception {


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

Reply via email to