private static void clearAndRecreateDB(HiveMetaStoreClient hmsc) throws Exception {
    hmsc.dropDatabase(dbName,
                      true,   // Delete data.
                      true,   // Ignore unknownDB.
                      true    // Cascade.
                      );

    new DatabaseBuilder()
        .setName(dbName)
        .create(hmsc, conf);
  }
Test to check PartitionSpec support in HiveMetaStore.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStorePartitionSpecs.java