public static void genLocalWorkForMapJoin(MapredWork newWork, MapJoinOperator newMapJoinOp,
      int mapJoinPos)
      throws SemanticException {
    try {
      // generate the local work for the big table alias
      MapJoinProcessor.genMapJoinLocalWork(newWork, newMapJoinOp, mapJoinPos);
      // clean up the mapred work
      newWork.getMapWork().setLeftInputJoin(false);
      newWork.getMapWork().setBaseSrc(null);
      newWork.getMapWork().setMapAliases(null);
    } catch (Exception e) {
      throw new SemanticException("Failed to generate new mapJoin operator " +
          "by exception : ", e);
    }
  }
Convert the join to a map-join and also generate any local work needed.

@param newWork MapredWork in which the conversion is to happen
@param op
         The join operator that needs to be converted to map-join
@param mapJoinPos
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/MapJoinProcessor.java