SENTRY-2428: Skip null partitions or partitions with null sds entries (Arjun Mishra reviewed by Na Li)
Change-Id: I3ad372400d482706f79d4570817e296332bb23c4
diff --git a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java
index 3e27d1b..4ff3dc9 100644
--- a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java
@@ -303,14 +303,13 @@
Collection<String> partitionNames = new ArrayList<>(tblParts.size());
for (Partition part : tblParts) {
- try {
+ if(part != null && part.getSd() != null) {
String partPath = pathFromURI(part.getSd().getLocation());
if (partPath != null) {
partitionNames.add(partPath.intern());
}
- } catch(Exception e) {
- LOGGER.error("Exception while fetching partitions for db = {} table = {}", dbName, tblName);
- throw e;
+ } else {
+ LOGGER.info("Partition or its storage descriptor is null while fetching partitions for db = {} table = {}", dbName, tblName);
}
}
return new ObjectMapping(authName, partitionNames);