diff --git a/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java b/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java index aafeaab..aaed02e 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java @@ -276,11 +276,13 @@ public URI getLocation() throws Exception { } 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) {