diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java index fa75c0d..8c866c0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java @@ -50,6 +50,7 @@ import org.apache.hadoop.hive.ql.plan.MapWork; import org.apache.hadoop.hive.ql.plan.ReduceWork; import org.apache.hadoop.hive.ql.plan.TezWork.EdgeType; +import org.apache.hadoop.hive.ql.session.SessionState; import org.apache.hadoop.hive.ql.stats.StatsFactory; import org.apache.hadoop.hive.ql.stats.StatsPublisher; import org.apache.hadoop.hive.shims.Hadoop20Shims.NullOutputCommitter; @@ -418,10 +419,20 @@ public Path getDefaultDestDir(Configuration conf) throws LoginException, IOExcep public List localizeTempFiles(Configuration conf) throws IOException, LoginException { List tmpResources = new ArrayList(); + String addedFiles = Utilities.getResourceFiles(conf, SessionState.ResourceType.FILE); + if (StringUtils.isNotBlank(addedFiles)) { + HiveConf.setVar(conf, ConfVars.HIVEADDEDFILES, addedFiles); + } + String addedJars = Utilities.getResourceFiles(conf, SessionState.ResourceType.JAR); + if (StringUtils.isNotBlank(addedJars)) { + HiveConf.setVar(conf, ConfVars.HIVEADDEDJARS, addedJars); + } + String addedArchives = Utilities.getResourceFiles(conf, SessionState.ResourceType.ARCHIVE); + if (StringUtils.isNotBlank(addedArchives)) { + HiveConf.setVar(conf, ConfVars.HIVEADDEDARCHIVES, addedArchives); + } + String auxJars = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEAUXJARS); - String addedJars = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEADDEDJARS); - String addedFiles = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEADDEDFILES); - String addedArchives = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEADDEDARCHIVES); // need to localize the additional jars and files @@ -448,6 +459,9 @@ public Path getDefaultDestDir(Configuration conf) throws LoginException, IOExcep String allFiles = auxJars + "," + addedJars + "," + addedFiles + "," + addedArchives; String[] allFilesArr = allFiles.split(","); for (String file : allFilesArr) { + if (!StringUtils.isNotBlank(file)) { + continue; + } String hdfsFilePathStr = hdfsDirPathStr + "/" + getResourceBaseName(file); LocalResource localResource = localizeResource(new Path(file), new Path(hdfsFilePathStr), conf);