private ReduceSinkOperator obtainFirstBroadcastInput(MapJoinOperator mapJoinOp) {
    return mapJoinOp.getParentOperators().get(0) instanceof ReduceSinkOperator ?
        (ReduceSinkOperator) mapJoinOp.getParentOperators().get(0) :
        (ReduceSinkOperator) mapJoinOp.getParentOperators().get(1);
  }
Try to reuse cache for broadcast side in mapjoin operators that share the same input.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java