use of org.apache.drill.exec.vector.complex.impl.VectorContainerWriter in project drill by axbaretto.
the class MaprDBJsonRecordReader method setup.
@Override
public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException {
this.vectorWriter = new VectorContainerWriter(output, unionEnabled);
this.operatorContext = context;
try {
table = MapRDB.getTable(tableName);
table.setOption(TableOption.EXCLUDEID, !includeId);
documentStream = table.find(condition, projectedFields);
documentReaderIterators = documentStream.documentReaders().iterator();
} catch (DBException e) {
throw new ExecutionSetupException(e);
}
}
use of org.apache.drill.exec.vector.complex.impl.VectorContainerWriter in project drill by axbaretto.
the class MongoRecordReader method setup.
@Override
public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException {
this.writer = new VectorContainerWriter(output, unionEnabled);
// BsonRecordReader
if (isBsonRecordReader) {
this.bsonReader = new BsonRecordReader(fragmentContext.getManagedBuffer(), Lists.newArrayList(getColumns()), readNumbersAsDouble);
logger.debug("Initialized BsonRecordReader. ");
} else {
this.jsonReader = new JsonReader.Builder(fragmentContext.getManagedBuffer()).schemaPathColumns(Lists.newArrayList(getColumns())).allTextMode(enableAllTextMode).readNumbersAsDouble(readNumbersAsDouble).enableNanInf(enableNanInf).build();
logger.debug(" Intialized JsonRecordReader. ");
}
}
use of org.apache.drill.exec.vector.complex.impl.VectorContainerWriter in project drill by axbaretto.
the class AvroRecordReader method setup.
@Override
public void setup(final OperatorContext context, final OutputMutator output) throws ExecutionSetupException {
writer = new VectorContainerWriter(output);
try {
reader = getReader(hadoop, fs);
logger.debug("Processing file : {}, start position : {}, end position : {} ", hadoop, start, end);
reader.sync(this.start);
} catch (IOException e) {
throw new ExecutionSetupException(e);
}
}
use of org.apache.drill.exec.vector.complex.impl.VectorContainerWriter in project drill by axbaretto.
the class JSONRecordReader method setup.
@Override
public void setup(final OperatorContext context, final OutputMutator output) throws ExecutionSetupException {
try {
if (hadoopPath != null) {
this.stream = fileSystem.openPossiblyCompressedStream(hadoopPath);
}
this.writer = new VectorContainerWriter(output, unionEnabled);
if (isSkipQuery()) {
this.jsonReader = new CountingJsonReader(fragmentContext.getManagedBuffer(), enableNanInf);
} else {
this.jsonReader = new JsonReader.Builder(fragmentContext.getManagedBuffer()).schemaPathColumns(ImmutableList.copyOf(getColumns())).allTextMode(enableAllTextMode).skipOuterList(true).readNumbersAsDouble(readNumbersAsDouble).enableNanInf(enableNanInf).build();
}
setupParser();
} catch (final Exception e) {
handleAndRaise("Failure reading JSON file", e);
}
}
use of org.apache.drill.exec.vector.complex.impl.VectorContainerWriter in project drill by axbaretto.
the class TestBsonRecordReader method setUp.
@BeforeClass
public static void setUp() {
BufferAllocator bufferAllocator = getDrillbitContext().getAllocator();
mutator = new TestOutputMutator(bufferAllocator);
writer = new VectorContainerWriter(mutator);
bsonReader = new BsonRecordReader(bufferAllocator.buffer(1024), false, false);
}
Aggregations