private static File createTempFile(HiveConf conf) throws IOException {
    String lScratchDir = HiveConf.getVar(conf, HiveConf.ConfVars.LOCAL_SCRATCH_DIR);
    String sessionID = conf.getVar(HiveConf.ConfVars.HIVE_SESSION_ID);

    return FileUtils.createTempFile(lScratchDir, sessionID, ".pipeout");
  }
@param conf
@return per-session temp file
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java