deniskuzZ commented on code in PR #4406:
URL: https://github.com/apache/hive/pull/4406#discussion_r1282875634
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezWork.java:
##########
@@ -513,4 +513,22 @@ private void connectUnionWorkWithWork(UnionWork unionWork,
BaseWork work, TezWor
unionWork.addUnionOperators(context.currentUnionOperators);
context.workWithUnionOperators.add(work);
}
+
+ /**
+ * If the given reduceWork is the merged work of a MergeJoinWork, return the
name of that MergeJoinWork.
+ * Otherwise, return the name of the given reduceWork.
+ */
+ private String getActualOutputWorkName(GenTezProcContext context, ReduceWork
reduceWork) {
Review Comment:
could we refactor this with streaming api?
````
private String getOutputWorkName(GenTezProcContext context, ReduceWork
reduceWork) {
return context.opMergeJoinWorkMap.values().stream()
.filter(mergeJoinWork ->
mergeJoinWork.getBaseWorkList().contains(reduceWork))
.map(MergeJoinWork::getMainWork)
// getMainWork() == null means that we have not visited the leaf
Operator of MergeJoinWork.
// In this case, GenTezWork will adjust the output name of merged
works
// by calling MergeJoinWork.addMergedWork() with non-null argument
for parameter work.
.filter(Objects::nonNull)
.findAny().orElse(reduceWork)
.getName();
}
````
--
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]