public static EdgeType determineEdgeType(BaseWork preceedingWork, BaseWork followingWork,
      ReduceSinkOperator reduceSinkOperator) {
    // The 1-1 edge should also work for sorted cases, however depending on the details of the shuffle
    // this might end up writing multiple compressed files or end up using an in-memory partitioned kv writer
    // the condition about ordering = false can be removed at some point with a tweak to the unordered writer
    // to never split a single output across multiple files (and never attempt a final merge)
    if (reduceSinkOperator.getConf().isForwarding() && !reduceSinkOperator.getConf().isOrdering()) {
      return EdgeType.ONE_TO_ONE_EDGE;
    }
    if (followingWork instanceof ReduceWork) {
      // Ideally there should be a better way to determine that the followingWork contains
      // a dynamic partitioned hash join, but in some cases (createReduceWork()) it looks like
      // the work must be created/connected first, before the GenTezProcContext can be updated
      // with the mapjoin/work relationship.
      ReduceWork reduceWork = (ReduceWork) followingWork;
      if (reduceWork.getReducer() instanceof MapJoinOperator) {
        MapJoinOperator joinOp = (MapJoinOperator) reduceWork.getReducer();
        if (joinOp.getConf().isDynamicPartitionHashJoin()) {
          return EdgeType.CUSTOM_SIMPLE_EDGE;
        }
      }
    }
    if (!reduceSinkOperator.getConf().isOrdering()) {
      //if no sort keys are specified, use an edge that does not sort
      return EdgeType.CUSTOM_SIMPLE_EDGE;
    }
    return EdgeType.SIMPLE_EDGE;
  }
Remove an operator branch. When we see a fork, we know it's time to do the removal.
@param event the leaf node of which branch to be removed
ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java