ngsg commented on code in PR #4360:
URL: https://github.com/apache/hive/pull/4360#discussion_r1225368491
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java:
##########
@@ -982,15 +943,88 @@ private static void
sharedWorkExtendedOptimization(ParseContext pctx, SharedWork
(Entry<String, TableScanOperator> e) -> e.getValue().getNumChild() ==
0);
}
- /**
- * Obtain the RS input for a mapjoin operator.
- */
- private static ReduceSinkOperator obtainBroadcastInput(MapJoinOperator
mapJoinOp) {
+ @VisibleForTesting
+ public void runMapJoinCacheReuseOptimization(
+ ParseContext pctx, SharedWorkOptimizerCache optimizerCache) throws
SemanticException {
+ // First we group together all the mapjoin operators whose first broadcast
input is the same.
+ final Multimap<Operator<?>, MapJoinOperator> parentToMapJoinOperators =
ArrayListMultimap.create();
+ for (Set<Operator<?>> workOperators : optimizerCache.getWorkGroups()) {
+ for (Operator<?> op : workOperators) {
+ if (op instanceof MapJoinOperator) {
+ MapJoinOperator mapJoinOp = (MapJoinOperator) op;
+ // Only allowed for mapjoin operator
+ if (!mapJoinOp.getConf().isBucketMapJoin() &&
!mapJoinOp.getConf().isDynamicPartitionHashJoin()) {
Review Comment:
Do you mean something like this?
```
if (!mapJoinOp.getConf().isBucketMapJoin() &&
!mapJoinOp.getConf().isDynamicPartitionHashJoin()) {
```
--
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]