hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1619931 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java
Date Fri, 22 Aug 2014 21:07:43 GMT
Author: brock
Date: Fri Aug 22 21:07:43 2014
New Revision: 1619931

URL: http://svn.apache.org/r1619931
Log:
HIVE-7829 - Entity.getLocation can throw an NPE (Brock reviewed by Szehon)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java?rev=1619931&r1=1619930&r2=1619931&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java Fri Aug 22 21:07:43
2014
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.net.URI;
 import java.util.Map;
 
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.metastore.api.Database;
 import org.apache.hadoop.hive.ql.metadata.DummyPartition;
 import org.apache.hadoop.hive.ql.metadata.Partition;
@@ -276,11 +277,13 @@ public class Entity implements Serializa
     }
 
     if (typ == Type.TABLE) {
-      return t.getDataLocation().toUri();
+      Path path = t.getDataLocation();
+      return path == null ? null : path.toUri();
     }
 
     if (typ == Type.PARTITION) {
-      return p.getDataLocation().toUri();
+      Path path = p.getDataLocation();
+      return path == null ? null : path.toUri();
     }
 
     if (typ == Type.DFS_DIR || typ == Type.LOCAL_DIR) {



Mime
View raw message