ColumnIO { ColumnIO(Type type, GroupColumnIO parent, int index) { this.type = type; this.parent = parent; this.index = index; this.name = type.getName(); } ColumnIO(Type type, GroupColumnIO parent, int index); String getFieldPath(int level); int[] getIndexFieldPath(); int getIndexFieldPath(int level); int getIndex(); String getName(); Type getType(); GroupColumnIO getParent(); @Override String toString();  }
@Test public void testColumnIO() { log(schema); log("r1"); log(r1); log("r2"); log(r2); MemPageStore memPageStore = new MemPageStore(); MemColumnWriteStore columns = new MemColumnWriteStore(memPageStore, 800); ColumnIOFactory columnIOFactory = new ColumnIOFactory(true); { MessageColumnIO columnIO = columnIOFactory.getColumnIO(schema); log(columnIO); GroupWriter groupWriter = new GroupWriter(columnIO.getRecordWriter(columns), schema); groupWriter.write(r1); groupWriter.write(r2); columns.flush(); log(columns); log("========="); RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO, schema, memPageStore); validateFSA(expectedFSA, columnIO, recordReader); List<Group> records = new ArrayList<Group>(); read(recordReader, schema, records); read(recordReader, schema, records); int i = 0; for (Group record : records) { log("r" + (++i)); log(record); } assertEquals("deserialization does not display the same result", r1.toString(), records.get(0).toString()); assertEquals("deserialization does not display the same result", r2.toString(), records.get(1).toString()); } { MessageColumnIO columnIO2 = columnIOFactory.getColumnIO(schema2); List<Group> records = new ArrayList<Group>(); RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO2, schema2, memPageStore); validateFSA(expectedFSA2, columnIO2, recordReader); read(recordReader, schema2, records); read(recordReader, schema2, records); int i = 0; for (Group record : records) { log("r" + (++i)); log(record); } assertEquals("deserialization does not display the expected result", pr1.toString(), records.get(0).toString()); assertEquals("deserialization does not display the expected result", pr2.toString(), records.get(1).toString()); } }