SENTRY-1044: Tables with non-hdfs locations breaks HMS startup ( Harsh J, Reviewed by: Sravya Tirukkovalur)
Change-Id: I56233e434466b2c03e3a759cafda95c9d46a2e44
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastoreCacheInitializer.java b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastoreCacheInitializer.java
index cdf1c59..7a19594 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastoreCacheInitializer.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastoreCacheInitializer.java
@@ -204,7 +204,9 @@
if (tbl.getSd().getLocation() != null) {
List<String> tblPath =
PathsUpdate.parsePath(tbl.getSd().getLocation());
- tblPathChange.addToAddPaths(tblPath);
+ if (tblPath != null) {
+ tblPathChange.addToAddPaths(tblPath);
+ }
List<String> tblPartNames =
hmsHandler.get_partition_names(db.getName(), tableName, (short) -1);
for (int i = 0; i < tblPartNames.size(); i += maxPartitionsPerCall) {