diff --git metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java index 12f3f16..cbcb20a 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java @@ -186,10 +186,13 @@ public static boolean updateTableStatsFast(Database db, Table tbl, Warehouse wh, public static boolean updateTableStatsFast(Database db, Table tbl, Warehouse wh, boolean madeDir, boolean forceRecompute) throws MetaException { FileStatus[] fileStatuses = {}; - if (tbl.getPartitionKeysSize() == 0) { // Update stats only when unpartitioned + if (tbl.getPartitionKeysSize() == 0) { + // Update stats only when unpartitioned fileStatuses = wh.getFileStatusesForUnpartitionedTable(db, tbl); + return updateTableStatsFast(tbl, fileStatuses, madeDir, forceRecompute); + } else { + return false; } - return updateTableStatsFast(tbl, fileStatuses, madeDir, forceRecompute); } /**