client.dropDatabase(databaseName, true, HCatClient.DropDBMode.CASCADE);
}
public static void createTable(String metaStoreUrl, String databaseName,
String tableName) 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"));
HCatCreateTableDesc tableDesc = HCatCreateTableDesc
.create(databaseName, tableName, cols)
.ifNotExists(true)
.comments("falcon integration test")
.build();
client.createTable(tableDesc);
}