You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2009/06/23 06:12:59 UTC

svn commit: r787535 - in /hadoop/hive/trunk: CHANGES.txt common/src/java/org/apache/hadoop/hive/conf/HiveConf.java ql/src/java/org/apache/hadoop/hive/ql/exec/MapRedTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java

Author: zshao
Date: Tue Jun 23 04:12:59 2009
New Revision: 787535

URL: http://svn.apache.org/viewvc?rev=787535&view=rev
Log:
HIVE-338. Postfix for HIVE-338. (zshao)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapRedTask.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=787535&r1=787534&r2=787535&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Tue Jun 23 04:12:59 2009
@@ -9,10 +9,6 @@
 
   NEW FEATURES
 
-    HIVE-338. add/delete jar commands, Hive Server fix for multithreading,
-    cli commands via hiveserver
-    (Min Zhou and Joydeep Sen Sarma via jssarma)
-
     HIVE-354. UDF for length of a string. (Neil Conway via namit).
 
     HIVE-402. Implement UDF regexp. (Raghotham Murthy via namit)
@@ -51,6 +47,12 @@
 
     HIVE-563. UDF for parsing the URL: parse_url. (Suresh Antony via zshao)
 
+    HIVE-338. add/delete jar commands, Hive Server fix for multithreading,
+    cli commands via hiveserver
+    (Min Zhou and Joydeep Sen Sarma via jssarma)
+
+    HIVE-338. Postfix for HIVE-338. (zshao)
+
   IMPROVEMENTS
     HIVE-389. Option to build without ivy (jssarma)
 

Modified: hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=787535&r1=787534&r2=787535&view=diff
==============================================================================
--- hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Tue Jun 23 04:12:59 2009
@@ -379,6 +379,7 @@
    */
   public void setAuxJars(String auxJars) {
     this.auxJars = auxJars;
+    setVar(this, ConfVars.HIVEAUXJARS, auxJars);
   }
   
   /**

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapRedTask.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapRedTask.java?rev=787535&r1=787534&r2=787535&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapRedTask.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapRedTask.java Tue Jun 23 04:12:59 2009
@@ -47,23 +47,26 @@
       // enable assertion
       String hadoopExec = conf.getVar(HiveConf.ConfVars.HADOOPBIN);
       String hiveJar = conf.getJar();
-      String hiveConfArgs = ExecDriver.generateCmdLine(conf);
-      String auxJars = conf.getAuxJars();
-      String addedJars = ExecDriver.getResourceFiles(conf, SessionState.ResourceType.JAR);
 
-      if (StringUtils.isEmpty(auxJars) && StringUtils.isEmpty(addedJars)) {
-        auxJars = " ";
-      } else {
-        String jarList;
-        if(StringUtils.isEmpty(auxJars)) {
-          jarList = addedJars;
-        } else if (StringUtils.isEmpty(auxJars)) {
-          jarList = auxJars;
+      String addedJars = ExecDriver.getResourceFiles(conf, SessionState.ResourceType.JAR);
+      if (!StringUtils.isEmpty(addedJars)) {
+        // Add addedJars to auxJars
+        String auxJars = conf.getAuxJars();
+        if (StringUtils.isEmpty(auxJars)) {
+          auxJars = addedJars;
         } else {
-          jarList = auxJars + "," + addedJars;
+          auxJars = auxJars + "," + addedJars;
         }
+        conf.setAuxJars(auxJars);
+      }
+      // Generate the hiveCOnfArgs after potentially adding the jars
+      String hiveConfArgs = ExecDriver.generateCmdLine(conf);
 
-        auxJars = " -libjars " + jarList + " ";
+      String auxJars = conf.getAuxJars();
+      if (StringUtils.isEmpty(auxJars)) {
+        auxJars = " ";
+      } else {
+        auxJars = " -libjars " + auxJars + " ";
       }
 
       mapredWork plan = getWork();

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java?rev=787535&r1=787534&r2=787535&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java Tue Jun 23 04:12:59 2009
@@ -570,7 +570,13 @@
       fs.close();
     } catch(IOException e){};
 
-    return (path.makeQualified(fs).toString());
+    String file = path.makeQualified(fs).toString();
+    // For compatibility with hadoop 0.17, change file:/a/b/c to file:///a/b/c 
+    if (StringUtils.startsWith(file, "file:/")
+        && !StringUtils.startsWith(file, "file:///")) {
+      file = "file:///" + file.substring("file:/".length());
+    }
+    return file;
   }
 
   public static List<String> mergeUniqElems(List<String> src, List<String> dest) {