public void testConversion() throws IOException {
Configuration conf = new Configuration();
JobContext jc = new JobContext(conf, new JobID());
HCatSchema schema = buildHiveSchema();
HCatInputStorageDriver isd = new RCFileInputDriver();
isd.setOriginalSchema(jc, schema);
isd.setOutputSchema(jc, schema);
isd.initialize(jc, new Properties());
byte[][] byteArray = buildBytesArray();
BytesRefArrayWritable bytesWritable = new BytesRefArrayWritable(byteArray.length);
for (int i = 0; i < byteArray.length; i++) {
BytesRefWritable cu = new BytesRefWritable(byteArray[i], 0, byteArray[i].length);
bytesWritable.set(i, cu);
}
//Convert byte array to HCatRecord using isd, convert hcatrecord back to byte array
//using osd, compare the two arrays
HCatRecord record = isd.convertToHCatRecord(null, bytesWritable);
HCatOutputStorageDriver osd = new RCFileOutputDriver();
osd.setSchema(jc, schema);
osd.initialize(jc, new Properties());