private static void createTable(HiveMetaStoreClient hmsc, boolean enablePartitionGrouping) throws Exception {


    List<FieldSchema> columns = new ArrayList<>();
    columns.add(new FieldSchema("foo", "string", ""));
    columns.add(new FieldSchema("bar", "string", ""));

    List<FieldSchema> partColumns = new ArrayList<>();
    partColumns.add(new FieldSchema("dt", "string", ""));
    partColumns.add(new FieldSchema("blurb", "string", ""));

    SerDeInfo serdeInfo = new SerDeInfo("LBCSerDe",
        "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe", new HashMap<>());

    StorageDescriptor storageDescriptor
        = new StorageDescriptor(columns, null,
        "org.apache.hadoop.hive.ql.io.RCFileInputFormat",
        "org.apache.hadoop.hive.ql.io.RCFileOutputFormat",
        false, 0, serdeInfo, null, null, null);

    Map<String, String> tableParameters = new HashMap<>();
    tableParameters.put("hive.hcatalog.partition.spec.grouping.enabled", enablePartitionGrouping? "true":"false");
    Table table = new Table(tableName, dbName, "", 0, 0, 0, storageDescriptor, partColumns, tableParameters, "", "", "");

    hmsc.createTable(table);
    Assert.assertTrue("Table " + dbName + "." + tableName + " does not exist",
      hmsc.tableExists(dbName, tableName));

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