public static void createTable(String metaStoreUrl, String databaseName, String tableName,
List<String> partitionKeys) throws Exception {
HCatClient client = HiveCatalogService.get(metaStoreUrl);
ArrayList<HCatFieldSchema> cols = new ArrayList<HCatFieldSchema>();
cols.add(new HCatFieldSchema("id", HCatFieldSchema.Type.INT, "id comment"));
cols.add(new HCatFieldSchema("value", HCatFieldSchema.Type.STRING, "value comment"));
List<HCatFieldSchema> partitionSchema = new ArrayList<HCatFieldSchema>();
for (String partitionKey : partitionKeys) {
partitionSchema.add(new HCatFieldSchema(partitionKey, HCatFieldSchema.Type.STRING, ""));
}
HCatCreateTableDesc tableDesc = HCatCreateTableDesc
.create(databaseName, tableName, cols)
.ifNotExists(true)