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


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConvertJoinMapJoin.java:
##########
@@ -755,6 +757,20 @@ private boolean checkConvertJoinSMBJoin(JoinOperator 
joinOp, OptimizeTezProcCont
         LOG.debug("External table {} found in join and also could not provide 
statistics - disabling SMB join.", sb);
         return false;
       }
+      // GBY operators buffers one record. These are processed when 
ReduceRecordSources flushes the operator tree
+      // when end of record stream reached. If the tree has more than two GBY 
operators CommonMergeJoinOperator can
+      // not process all buffered records.
+      // HIVE-27788
+      if (parentOp.getParentOperators() != null) {
+        for (Operator<?> grandParent : parentOp.getParentOperators()) {

Review Comment:
   Before the SMB conversion the direct parents of the merge join operator are 
RS operators. Passing them to `hasMoreOperatorsThan` would immediately stop 
traversal because RS operator is a stop operator in this search.



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