private static int calculatePartPrefix(Table tbl, Set<String> partSpecKeys) {
    int partPrefixToDrop = 0;
    for (FieldSchema fs : tbl.getPartCols()) {
      if (!partSpecKeys.contains(fs.getName())) {
        break;
      }
      ++partPrefixToDrop;
    }
    return partPrefixToDrop;
  }
Calculates the partition prefix length based on the drop spec.
This is used to avoid deleting archived partitions with lower level.
For example, if, for A and B key cols, drop spec is A=5, B=6, we shouldn't drop
archived A=5/, because it can contain B-s other than 6.
ql/src/java/org/apache/hadoop/hive/ql/parse/ParseUtils.java