private static String getPartitionPath(Table table, List<String> partValues) {

    return partValues.get(1).equalsIgnoreCase("isLocatedOutsideTablePath")? // i.e. Is the partition outside the table-dir?
           table.getSd().getLocation().replace(table.getTableName(), "location_outside_" + table.getTableName())
              + "_" + partValues.get(0) + "_" + partValues.get(1)
        : null ; // Use defaults... Partitions are put in the table directory.

  }
Test to check PartitionSpec support in HiveMetaStore.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStorePartitionSpecs.java