You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2014/03/19 17:47:47 UTC
svn commit: r1579293 - in
/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez: DagUtils.java
TezSessionState.java
Author: sershe
Date: Wed Mar 19 16:47:47 2014
New Revision: 1579293
URL: http://svn.apache.org/r1579293
Log:
HIVE-6690 : NPE in tez session state (Sergey Shelukhin, reviewed by Gunther Hagleitner)
Modified:
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java
Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java?rev=1579293&r1=1579292&r2=1579293&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java Wed Mar 19 16:47:47 2014
@@ -599,6 +599,24 @@ public class DagUtils {
// we need the directory on hdfs to which we shall put all these files
// Use HIVE_JAR_DIRECTORY only if it's set explicitly; otherwise use default directory
+ String hdfsDirPathStr = getHiveJarDirectory(conf);
+
+ 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);
+ tmpResources.add(localResource);
+ }
+
+ return tmpResources;
+ }
+
+ public String getHiveJarDirectory(Configuration conf) throws IOException, LoginException {
FileStatus fstatus = null;
String hdfsDirPathStr = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_JAR_DIRECTORY, null);
if (hdfsDirPathStr != null) {
@@ -618,20 +636,7 @@ public class DagUtils {
Path destDir = getDefaultDestDir(conf);
hdfsDirPathStr = destDir.toString();
}
-
- 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);
- tmpResources.add(localResource);
- }
-
- return tmpResources;
+ return hdfsDirPathStr;
}
// the api that finds the jar being used by this class on disk
Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java?rev=1579293&r1=1579292&r2=1579293&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java Wed Mar 19 16:47:47 2014
@@ -247,7 +247,7 @@ public class TezSessionState {
*/
private LocalResource createHiveExecLocalResource()
throws IOException, LoginException, URISyntaxException {
- String hiveJarDir = conf.getVar(HiveConf.ConfVars.HIVE_JAR_DIRECTORY);
+ String hiveJarDir = utils.getHiveJarDirectory(conf);
String currentVersionPathStr = utils.getExecJarPathLocal();
String currentJarName = utils.getResourceBaseName(currentVersionPathStr);
FileSystem fs = null;