@Test public void testListResize() throws Exception { Schema schema = new Schema.Parser().parse(this.getClass().getClassLoader().getResourceAsStream("list_map_test/schema.avsc")); TypeDescription orcSchema = AvroOrcSchemaConverter.getOrcSchema(schema); GenericRecordToOrcValueWriter valueWriter = new GenericRecordToOrcValueWriter(orcSchema, schema); VectorizedRowBatch rowBatch = orcSchema.createRowBatch(10); List<GenericRecord> recordList = GobblinOrcWriterTest .deserializeAvroRecords(this.getClass(), schema, "list_map_test/data.json"); Assert.assertEquals(recordList.size(), 6); for (GenericRecord record : recordList) { valueWriter.write(record, rowBatch); } Assert.assertEquals(valueWriter.resizeCount, 2); }
@Override public void write(GenericRecord value, VectorizedRowBatch output) throws IOException { int row = output.size++; for (int c = 0; c < converters.length; ++c) { ColumnVector col = output.cols[c]; if (value.get(c) == null) { col.noNulls = false; col.isNull[row] = true; } else { col.isNull[row] = false; converters[c].addValue(row, c, value.get(c), col); } } }
GenericRecordToOrcValueWriter implements OrcValueWriter<GenericRecord> { @Override public void write(GenericRecord value, VectorizedRowBatch output) throws IOException { int row = output.size++; for (int c = 0; c < converters.length; ++c) { ColumnVector col = output.cols[c]; if (value.get(c) == null) { col.noNulls = false; col.isNull[row] = true; } else { col.isNull[row] = false; converters[c].addValue(row, c, value.get(c), col); } } } }
GenericRecordToOrcValueWriter implements OrcValueWriter<GenericRecord> { @Override public void write(GenericRecord value, VectorizedRowBatch output) throws IOException { int row = output.size++; for (int c = 0; c < converters.length; ++c) { ColumnVector col = output.cols[c]; if (value.get(c) == null) { col.noNulls = false; col.isNull[row] = true; } else { col.isNull[row] = false; converters[c].addValue(row, c, value.get(c), col); } } } GenericRecordToOrcValueWriter(TypeDescription typeDescription, Schema avroSchema);  GenericRecordToOrcValueWriter(TypeDescription typeDescription, Schema avroSchema, State state); }
GenericRecordToOrcValueWriter implements OrcValueWriter<GenericRecord> { @Override public void write(GenericRecord value, VectorizedRowBatch output) throws IOException { int row = output.size++; for (int c = 0; c < converters.length; ++c) { ColumnVector col = output.cols[c]; if (value.get(c) == null) { col.noNulls = false; col.isNull[row] = true; } else { col.isNull[row] = false; converters[c].addValue(row, c, value.get(c), col); } } } GenericRecordToOrcValueWriter(TypeDescription typeDescription, Schema avroSchema);  GenericRecordToOrcValueWriter(TypeDescription typeDescription, Schema avroSchema, State state); @Override void write(GenericRecord value, VectorizedRowBatch output); }
GenericRecordToOrcValueWriter implements OrcValueWriter<GenericRecord> { @Override public void write(GenericRecord value, VectorizedRowBatch output) throws IOException { int row = output.size++; for (int c = 0; c < converters.length; ++c) { ColumnVector col = output.cols[c]; if (value.get(c) == null) { col.noNulls = false; col.isNull[row] = true; } else { col.isNull[row] = false; converters[c].addValue(row, c, value.get(c), col); } } } GenericRecordToOrcValueWriter(TypeDescription typeDescription, Schema avroSchema);  GenericRecordToOrcValueWriter(TypeDescription typeDescription, Schema avroSchema, State state); @Override void write(GenericRecord value, VectorizedRowBatch output); @VisibleForTesting
  public int resizeCount; }