use of org.apache.drill.exec.record.ColumnConverter in project drill by apache.
the class AvroColumnConverterFactory method buildMapMembers.
public void buildMapMembers(GenericRecord genericRecord, TupleMetadata providedSchema, TupleWriter tupleWriter, List<ColumnConverter> converters) {
// fill in tuple schema for cases when it contains recursive named record types
TupleMetadata readerSchema = AvroSchemaUtil.convert(genericRecord.getSchema());
TupleMetadata tableSchema = FixedReceiver.Builder.mergeSchemas(providedSchema, readerSchema);
tableSchema.toMetadataList().forEach(tupleWriter::addColumn);
IntStream.range(0, tableSchema.size()).mapToObj(i -> getConverter(providedSchema, readerSchema.metadata(i), tupleWriter.column(i))).forEach(converters::add);
}
Aggregations