private static void resetUmaskInConf(Configuration conf, boolean unsetUmask, String origUmask) {
    if (unsetUmask) {
      if (origUmask != null) {
        conf.set(FsPermission.UMASK_LABEL, origUmask);
      } else {
        conf.unset(FsPermission.UMASK_LABEL);
      }
    }
  }
Hive uses tmp directories to capture the output of each FileSinkOperator.
This method creates all necessary tmp directories for FileSinks in the ReduceWork.

@param conf Used to get the right FileSystem
@param rWork Used to find FileSinkOperators
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java