private Path getBaseDir(MapredLocalWork localWork) throws Exception {
    if (ShimLoader.getHadoopShims().isLocalMode(hconf)) {
      return localWork.getTmpPath();
    }
    Path[] localArchives = DistributedCache.getLocalCacheArchives(hconf);
    if (localArchives != null) {
      String stageID = localWork.getStageID();
      String suffix = Utilities.generateTarFileName(stageID);
      FileSystem localFs = FileSystem.getLocal(hconf);
      for (Path archive : localArchives) {
        if (archive.getName().endsWith(suffix)) {
          return archive.makeQualified(localFs);
        }
      }
    }
    return null;
  }
HashTableLoader for MR loads the hashtable for MapJoins from local disk (hashtables
are distributed by using the DistributedCache.
ql/src/java/org/apache/hadoop/hive/ql/exec/mr/HashTableLoader.java