public static class MapHCatWrite extends Mapper<LongWritable, Text, BytesWritable, HCatRecord> {
@Override
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
OutputJobInfo jobInfo = (OutputJobInfo)HCatUtil.deserialize(context.getConfiguration().get(HCatConstants.HCAT_KEY_OUTPUT_INFO));
HCatRecord record = new DefaultHCatRecord(3);
HCatSchema schema = jobInfo.getOutputSchema();
String vals[] = value.toString().split(",");
record.setInteger("key",schema,Integer.parseInt(vals[0]));
for(int i=1;i<vals.length;i++) {
String pair[] = vals[i].split(":");
record.set(pair[0],schema,pair[1]);
}
context.write(null,record);
}