hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject svn commit: r1643551 - /hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
Date Sat, 06 Dec 2014 16:33:52 GMT
Author: xuefu
Date: Sat Dec  6 16:33:52 2014
New Revision: 1643551

URL: http://svn.apache.org/r1643551
Log:
HIVE-9024: NullPointerException when starting webhcat server if templeton.hive.properties
is not set (Na via Xuefu)

Modified:
    hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java?rev=1643551&r1=1643550&r2=1643551&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
(original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
Sat Dec  6 16:33:52 2014
@@ -322,10 +322,14 @@ public class AppConfig extends Configura
     String[] props= StringUtils.split(get(HIVE_PROPS_NAME));
     //since raw data was (possibly) escaped to make split work,
     //now need to remove escape chars so they don't interfere with downstream processing
-    for(int i = 0; i < props.length; i++) {
-      props[i] = TempletonUtils.unEscapeString(props[i]);
+    if (props == null) {
+      return Collections.emptyList();
+    } else {
+      for(int i = 0; i < props.length; i++) {
+        props[i] = TempletonUtils.unEscapeString(props[i]);
+      }
+      return Arrays.asList(props);
     }
-    return Arrays.asList(props);
   }
 
   public String[] overrideJars() {



Mime
View raw message