kasakrisz commented on code in PR #4864:
URL: https://github.com/apache/hive/pull/4864#discussion_r1395385089


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorUtils.java:
##########
@@ -176,6 +176,37 @@ public static <T> Set<T> 
findOperatorsUpstreamJoinAccounted(Operator<?> start, C
     return found;
   }
 
+  /**
+   * Check whether there are more operators in the specified operator tree 
branch than the given limit
+   * @param start root of the operator tree to check
+   * @param opClazz type of operator to track
+   * @param limit maximum allowed number of operator in a branch of the tree
+   * @return true of limit is exceeded false otherwise
+   * @param <T> type of operator to track
+   */
+  public static <T> boolean hasMoreOperatorsThan(Operator<?> start, Class<T> 
opClazz, int limit) {

Review Comment:
   I don't see how `iterateParents` could be used because we have to count the 
number of GBYs and if the branch has a Join operator we need some backtrack 
logic to start over the counting when finished traversing the 1st branch of the 
join but the number of GBYs in the children of the join has to be kept.
   
   Could you please elaborate the first suggestion?



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