use of io.crate.expression.reference.file.FileLineReferenceResolver 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