stats[7].toString());
assertEquals("count: 2 min: bye max: hi", stats[9].toString());
// check the inspectors
StructObjectInspector readerInspector =
(StructObjectInspector) reader.getObjectInspector();
assertEquals(ObjectInspector.Category.STRUCT,
readerInspector.getCategory());
assertEquals("struct<boolean1:boolean,byte1:tinyint,short1:smallint,"
+ "int1:int,long1:bigint,float1:float,double1:double,bytes1:"
+ "binary,string1:string,middle:struct<list:array<struct<int1:int,"
+ "string1:string>>>,list:array<struct<int1:int,string1:string>>,"
+ "map:map<string,struct<int1:int,string1:string>>>",
readerInspector.getTypeName());
List<? extends StructField> fields =
readerInspector.getAllStructFieldRefs();
BooleanObjectInspector bo = (BooleanObjectInspector) readerInspector.
getStructFieldRef("boolean1").getFieldObjectInspector();
ByteObjectInspector by = (ByteObjectInspector) readerInspector.
getStructFieldRef("byte1").getFieldObjectInspector();
ShortObjectInspector sh = (ShortObjectInspector) readerInspector.
getStructFieldRef("short1").getFieldObjectInspector();
IntObjectInspector in = (IntObjectInspector) readerInspector.
getStructFieldRef("int1").getFieldObjectInspector();
LongObjectInspector lo = (LongObjectInspector) readerInspector.
getStructFieldRef("long1").getFieldObjectInspector();
FloatObjectInspector fl = (FloatObjectInspector) readerInspector.
getStructFieldRef("float1").getFieldObjectInspector();
DoubleObjectInspector dbl = (DoubleObjectInspector) readerInspector.
getStructFieldRef("double1").getFieldObjectInspector();
BinaryObjectInspector bi = (BinaryObjectInspector) readerInspector.
getStructFieldRef("bytes1").getFieldObjectInspector();
StringObjectInspector st = (StringObjectInspector) readerInspector.
getStructFieldRef("string1").getFieldObjectInspector();
StructObjectInspector mid = (StructObjectInspector) readerInspector.
getStructFieldRef("middle").getFieldObjectInspector();
List<? extends StructField> midFields =
mid.getAllStructFieldRefs();
ListObjectInspector midli =
(ListObjectInspector) midFields.get(0).getFieldObjectInspector();
StructObjectInspector inner = (StructObjectInspector)
midli.getListElementObjectInspector();
List<? extends StructField> inFields = inner.getAllStructFieldRefs();
IntObjectInspector inner_in = (IntObjectInspector) inFields.get(0).getFieldObjectInspector();
StringObjectInspector inner_st = (StringObjectInspector) inFields.get(1).getFieldObjectInspector();
ListObjectInspector li = (ListObjectInspector) readerInspector.
getStructFieldRef("list").getFieldObjectInspector();
MapObjectInspector ma = (MapObjectInspector) readerInspector.
getStructFieldRef("map").getFieldObjectInspector();
StructObjectInspector lc = (StructObjectInspector)
li.getListElementObjectInspector();
StringObjectInspector mk = (StringObjectInspector)
ma.getMapKeyObjectInspector();
StructObjectInspector mv = (StructObjectInspector)
ma.getMapValueObjectInspector();
RecordReader rows = reader.rows(null);
Object row = rows.next(null);
assertNotNull(row);
// check the contents of the first row