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


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/routing/PlanNodeRoutingQueryBuilder.java:
##########
@@ -85,6 +85,27 @@ public static PinotQuery createPinotQueryForRouting(String 
tableName, PlanNode l
     return pinotQuery;
   }
 
+  /// Whether [#createPinotQueryForRouting] can fold the given leaf stage 
tree, i.e. whether it holds no multi-input
+  /// node. Lets a caller skip the attempt rather than pay a thrown-and-caught 
exception per query, which a colocated
+  /// semi-join's probe leaf -- the one holding the join -- would otherwise do 
on every query. It lives here so that it
+  /// walks the tree the same way [#accumulateBottomToTop] does; the two 
disagreeing would either bring the exception
+  /// back or, worse, silently refuse shapes that fold perfectly well.
+  ///
+  /// A `true` result is not a promise that the fold succeeds: the tree may 
still be missing a table scan, which only
+  /// the fold itself detects.
+  public static boolean canBuildRoutingQuery(PlanNode leafStageRoot) {

Review Comment:
   Maybe we can add some tests and/or make it package-protected. Not blocker



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