diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java b/metastore/src/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java index b454372..b6fb4fd 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java @@ -137,7 +137,7 @@ public static synchronized void removeTableFromCache(String dbName, String tblNa } public static synchronized ColumnStatisticsObj getCachedTableColStats(String colStatsCacheKey) { - return tableColStatsCache.get(colStatsCacheKey).deepCopy(); + return tableColStatsCache.get(colStatsCacheKey)!=null?tableColStatsCache.get(colStatsCacheKey).deepCopy():null; } public static synchronized void removeTableColStatsFromCache(String dbName, String tblName) { @@ -426,7 +426,7 @@ public static synchronized int getCachedPartitionCount() { } public static synchronized ColumnStatisticsObj getCachedPartitionColStats(String key) { - return partitionColStatsCache.get(key).deepCopy(); + return partitionColStatsCache.get(key)!=null?partitionColStatsCache.get(key).deepCopy():null; } public static synchronized void addPartitionColStatsToCache(String dbName, String tableName,