public MapredLocalWork extractDirectWorks(
      Map<MapJoinOperator, List<Operator<? extends OperatorDesc>>> directWorks) {
    MapredLocalWork newLocalWork = new MapredLocalWork();
    newLocalWork.setTmpPath(tmpPath);
    newLocalWork.setInputFileChangeSensitive(inputFileChangeSensitive);

    Set<Operator<?>> validWorks = getDirectWorks(directWorks.values());
    if (validWorks.isEmpty()) {
      // all small aliases are staged.. no need full bucket context
      newLocalWork.setBucketMapjoinContext(copyPartSpecMappingOnly());
      return newLocalWork;
    }
    newLocalWork.directFetchOp =
        new HashMap<MapJoinOperator, List<Operator<? extends OperatorDesc>>>(directWorks);
    newLocalWork.aliasToWork = new LinkedHashMap<String, Operator<? extends OperatorDesc>>();
    newLocalWork.aliasToFetchWork = new LinkedHashMap<String, FetchWork>();

    Map<String, Operator<?>> works = new HashMap<String, Operator<?>>(aliasToWork);
    for (Map.Entry<String, Operator<?>> entry : works.entrySet()) {
      String alias = entry.getKey();
      boolean notStaged = validWorks.contains(entry.getValue());
      newLocalWork.aliasToWork.put(alias, notStaged ? aliasToWork.remove(alias) : null);
      newLocalWork.aliasToFetchWork.put(alias, notStaged ? aliasToFetchWork.remove(alias) : null);
    }
    // copy full bucket context
    newLocalWork.setBucketMapjoinContext(getBucketMapjoinContext());
    return newLocalWork;
  }
@param aliasToFetchWork
         the aliasToFetchWork to set
ql/src/java/org/apache/hadoop/hive/ql/plan/MapredLocalWork.java