ngsg commented on code in PR #5717:
URL: https://github.com/apache/hive/pull/5717#discussion_r2086305285


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java:
##########
@@ -1427,12 +1426,29 @@ private static SharedResult 
extractSharedOptimizationInfoForRoot(ParseContext pc
     if (equalOp1.getNumChild() > 1 || equalOp2.getNumChild() > 1) {
       // TODO: Support checking multiple child operators to merge further.
       discardableInputOps.addAll(gatherDPPBranchOps(pctx, optimizerCache, 
discardableOps));
-      return new SharedResult(retainableOps, discardableOps, 
discardableInputOps,
-          dataSize, maxDataSize);
+
+      // Accumulate InMemoryDataSize of unmerged MapJoin operators.
+      Set<Operator<?>> opsWork1 = findWorkOperators(optimizerCache, 
retainableTsOp);
+      for (Operator<?> op : opsWork1) {
+        if (op instanceof MapJoinOperator) {
+          MapJoinOperator mop = (MapJoinOperator) op;
+          dataSize = StatsUtils.safeAdd(dataSize, 
mop.getConf().getInMemoryDataSize());
+          maxDataSize = 
mop.getConf().getMemoryMonitorInfo().getAdjustedNoConditionalTaskSize();

Review Comment:
   I checked the test and found that I made a mistake in the qfile. The second 
select query was intended to cover this part, but the current version does not 
cover it properly. I'll update the qfile in the next commit to ensure that the 
intended scenario is properly covered. Thank you for pointint it out.



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