Object theRecordObject = row.get(0);
System.out.println("theRecordObject = " + theRecordObject.getClass().getCanonicalName());
// The original record was lost in the deserialization, so just go the
// correct way, through objectinspectors
StandardStructObjectInspector oi = (StandardStructObjectInspector)aoig.getObjectInspector();
List<? extends StructField> allStructFieldRefs = oi.getAllStructFieldRefs();
assertEquals(1, allStructFieldRefs.size());
StructField fieldRefForaRecord = allStructFieldRefs.get(0);
assertEquals("arecord", fieldRefForaRecord.getFieldName());
Object innerRecord2 = oi.getStructFieldData(row, fieldRefForaRecord);
// Extract innerRecord field refs
StandardStructObjectInspector innerRecord2OI =
(StandardStructObjectInspector) fieldRefForaRecord.getFieldObjectInspector();
List<? extends StructField> allStructFieldRefs1 = innerRecord2OI.getAllStructFieldRefs();
assertEquals(3, allStructFieldRefs1.size());
assertEquals("int1", allStructFieldRefs1.get(0).getFieldName());
assertEquals("boolean1", allStructFieldRefs1.get(1).getFieldName());
assertEquals("long1", allStructFieldRefs1.get(2).getFieldName());
innerRecord2OI.getStructFieldsDataAsList(innerRecord2);
assertEquals(42, innerRecord2OI.getStructFieldData(innerRecord2, allStructFieldRefs1.get(0)));
assertEquals(true, innerRecord2OI.getStructFieldData(innerRecord2, allStructFieldRefs1.get(1)));
assertEquals(42432234234l, innerRecord2OI.getStructFieldData(innerRecord2, allStructFieldRefs1.get(2)));
}