ankitsultana commented on code in PR #17439:
URL: https://github.com/apache/pinot/pull/17439#discussion_r2651804348


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -525,8 +526,12 @@ protected BrokerResponse doHandleRequest(long requestId, 
String query, SqlNodeAn
       routeProvider = _implicitHybridTableRouteProvider;
     }
 
+    // Get the appropriate routing manager based on query options
+    RoutingManager routingManager = _multiClusterRoutingContext != null && 
logicalTableConfig != null
+        ? 
_multiClusterRoutingContext.getRoutingManager(pinotQuery.getQueryOptions())
+        : _routingManager;
     // Get the tables hit by the request
-    TableRouteInfo routeInfo = routeProvider.getTableRouteInfo(tableName, 
_tableCache, _routingManager);
+    TableRouteInfo routeInfo = routeProvider.getTableRouteInfo(tableName, 
_tableCache, routingManager);

Review Comment:
   It seems it's pretty easy to create a bug in a future code change where 
instead of passing `routingManager` someone uses `_routingManager`.
   
   Maybe rename `_routingManager` to `_defaultRoutingManager` and add a comment 
on the var declaration?



##########
pinot-core/src/main/java/org/apache/pinot/core/routing/LogicalTableRouteProvider.java:
##########
@@ -29,13 +29,46 @@
 import org.apache.pinot.spi.config.table.TableConfig;
 import org.apache.pinot.spi.config.table.TableType;
 import org.apache.pinot.spi.data.LogicalTableConfig;
+import org.apache.pinot.spi.data.PhysicalTableConfig;
 import org.apache.pinot.spi.utils.builder.TableNameBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 public class LogicalTableRouteProvider implements TableRouteProvider {
   private static final Logger LOGGER = 
LoggerFactory.getLogger(LogicalTableRouteProvider.class);
+  private final MultiClusterRoutingContext _multiClusterRoutingContext;

Review Comment:
   `@Nullable`



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