use of io.crate.execution.engine.collect.files.LocalFsFileInputFactory in project crate by crate.
the class CsvReaderBenchmark method measureFileReadingIteratorForCSV.
@Benchmark()
public void measureFileReadingIteratorForCSV(Blackhole blackhole) {
Reference raw = createReference("_raw", DataTypes.STRING);
InputFactory.Context<LineCollectorExpression<?>> ctx = inputFactory.ctxForRefs(txnCtx, FileLineReferenceResolver::getImplementation);
List<Input<?>> inputs = Collections.singletonList(ctx.add(raw));
BatchIterator<Row> batchIterator = FileReadingIterator.newInstance(Collections.singletonList(fileUri), inputs, ctx.expressions(), null, Map.of(LocalFsFileInputFactory.NAME, new LocalFsFileInputFactory()), false, 1, 0, CopyFromParserProperties.DEFAULT, CSV, Settings.EMPTY);
while (batchIterator.moveNext()) {
blackhole.consume(batchIterator.currentElement().get(0));
}
}
use of io.crate.execution.engine.collect.files.LocalFsFileInputFactory in project crate by crate.
the class JsonReaderBenchmark method measureFileReadingIteratorForJson.
@Benchmark()
public void measureFileReadingIteratorForJson(Blackhole blackhole) {
Reference raw = createReference("_raw", DataTypes.STRING);
InputFactory.Context<LineCollectorExpression<?>> ctx = inputFactory.ctxForRefs(txnCtx, FileLineReferenceResolver::getImplementation);
List<Input<?>> inputs = Collections.singletonList(ctx.add(raw));
BatchIterator<Row> batchIterator = FileReadingIterator.newInstance(Collections.singletonList(fileUri), inputs, ctx.expressions(), null, Map.of(LocalFsFileInputFactory.NAME, new LocalFsFileInputFactory()), false, 1, 0, CopyFromParserProperties.DEFAULT, JSON, Settings.EMPTY);
while (batchIterator.moveNext()) {
blackhole.consume(batchIterator.currentElement().get(0));
}
}
Aggregations