You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "deniskuzZ (via GitHub)" <gi...@apache.org> on 2023/08/03 08:57:07 UTC
[GitHub] [hive] deniskuzZ commented on a diff in pull request #4406: HIVE-27303: Set correct output name to ReduceSink when there is a SMB join after Union
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)
.filter(Objects::nonNull)
.findAny().orElse(reduceWork)
}
````
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org