@BeforeMethod
private void addPartitions() throws Exception {
Map<String, String> firstPtn = new HashMap<String, String>();
firstPtn.put("ds", "20130903"); //yyyyMMDD
firstPtn.put("region", "us");
HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(
DATABASE_NAME, TABLE_NAME, null, firstPtn).build();
client.addPartition(addPtn);
Map<String, String> secondPtn = new HashMap<String, String>();
secondPtn.put("ds", "20130903");
secondPtn.put("region", "in");
HCatAddPartitionDesc addPtn2 = HCatAddPartitionDesc.create(
DATABASE_NAME, TABLE_NAME, null, secondPtn).build();
client.addPartition(addPtn2);
Map<String, String> thirdPtn = new HashMap<String, String>();
thirdPtn.put("ds", "20130902");
thirdPtn.put("region", "in");
HCatAddPartitionDesc addPtn3 = HCatAddPartitionDesc.create(
DATABASE_NAME, TABLE_NAME, null, thirdPtn).build();
client.addPartition(addPtn3);
}