diff --git metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java index d616946..133ac13 100755 --- metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java @@ -420,9 +420,9 @@ public static void makeSpecFromName(Map partSpec, Path currPath) currPath = currPath.getParent(); } while (currPath != null && !currPath.getName().isEmpty()); - // reverse the list since we checked the part from leaf dir to table's base dir - for (int i = kvs.size(); i > 0; i--) { - partSpec.put(kvs.get(i - 1)[0], kvs.get(i - 1)[1]); + // we checked the part from leaf dir to table's base dir + for (int i = 0; i < kvs.size(); i++) { + partSpec.put(kvs.get(i)[0], kvs.get(i)[1]); } }