use of org.apache.drill.exec.record.ColumnConverterFactory in project drill by apache.
the class EnumerableRecordReader method open.
@Override
public boolean open(SchemaNegotiator negotiator) {
TupleMetadata providedSchema = negotiator.providedSchema();
loader = negotiator.build();
setup(negotiator.context());
ColumnConverterFactory factory = new ColumnConverterFactory(providedSchema);
converter = factory.getRootConverter(providedSchema, new TupleSchema(), loader.writer());
return true;
}
use of org.apache.drill.exec.record.ColumnConverterFactory in project drill by apache.
the class IcebergRecordReader method open.
@Override
public boolean open(SchemaNegotiator negotiator) {
TupleSchema tableSchema = new TupleSchema();
tableScan.schema().columns().stream().map(IcebergColumnConverterFactory::getColumnMetadata).forEach(tableSchema::add);
TupleMetadata providedSchema = negotiator.providedSchema();
TupleMetadata tupleSchema = FixedReceiver.Builder.mergeSchemas(providedSchema, tableSchema);
negotiator.tableSchema(tupleSchema, true);
loader = negotiator.build();
this.taskToClose = new ScanTaskTableScanIterable(tableScan, work.getScanTask());
this.records = taskToClose.iterator();
ColumnConverterFactory factory = new IcebergColumnConverterFactory(providedSchema);
converter = factory.getRootConverter(providedSchema, tableSchema, loader.writer());
return true;
}
Aggregations