use of org.apache.druid.segment.QueryableIndexStorageAdapter in project druid by druid-io.
the class FilterPartitionBenchmark method readOrFilter.
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void readOrFilter(Blackhole blackhole) {
Filter filter = new NoBitmapSelectorFilter("dimSequential", "199");
Filter filter2 = new AndFilter(Arrays.asList(new SelectorFilter("dimMultivalEnumerated2", "Corundum"), new NoBitmapSelectorFilter("dimMultivalEnumerated", "Bar")));
Filter orFilter = new OrFilter(Arrays.asList(filter, filter2));
StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
Sequence<Cursor> cursors = makeCursors(sa, orFilter);
readCursors(cursors, blackhole);
}
use of org.apache.druid.segment.QueryableIndexStorageAdapter in project druid by druid-io.
the class FilterPartitionBenchmark method timeFilterNone.
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void timeFilterNone(Blackhole blackhole) {
StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
Sequence<Cursor> cursors = makeCursors(sa, timeFilterNone);
readCursorsLong(cursors, blackhole);
}
use of org.apache.druid.segment.QueryableIndexStorageAdapter in project druid by druid-io.
the class FilterPartitionBenchmark method readWithPostFilter.
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void readWithPostFilter(Blackhole blackhole) {
Filter filter = new NoBitmapSelectorFilter("dimSequential", "199");
StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
Sequence<Cursor> cursors = makeCursors(sa, filter);
readCursors(cursors, blackhole);
}
use of org.apache.druid.segment.QueryableIndexStorageAdapter in project druid by druid-io.
the class ExpressionSelectorBenchmark method timeFormatUsingExpression.
@Benchmark
public void timeFormatUsingExpression(Blackhole blackhole) {
final Sequence<Cursor> cursors = new QueryableIndexStorageAdapter(index).makeCursors(null, index.getDataInterval(), VirtualColumns.create(ImmutableList.of(new ExpressionVirtualColumn("v", "timestamp_format(__time, 'yyyy-MM-dd')", ColumnType.STRING, TestExprMacroTable.INSTANCE))), Granularities.ALL, false, null);
final List<?> results = cursors.map(cursor -> {
final DimensionSelector selector = cursor.getColumnSelectorFactory().makeDimensionSelector(DefaultDimensionSpec.of("v"));
consumeDimension(cursor, selector, blackhole);
return null;
}).toList();
blackhole.consume(results);
}
use of org.apache.druid.segment.QueryableIndexStorageAdapter in project druid by druid-io.
the class ExpressionSelectorBenchmark method timeFormatUsingExtractionFn.
@Benchmark
public void timeFormatUsingExtractionFn(Blackhole blackhole) {
final Sequence<Cursor> cursors = new QueryableIndexStorageAdapter(index).makeCursors(null, index.getDataInterval(), VirtualColumns.EMPTY, Granularities.ALL, false, null);
final List<?> results = cursors.map(cursor -> {
final DimensionSelector selector = cursor.getColumnSelectorFactory().makeDimensionSelector(new ExtractionDimensionSpec(ColumnHolder.TIME_COLUMN_NAME, "v", new TimeFormatExtractionFn("yyyy-MM-dd", null, null, null, false)));
consumeDimension(cursor, selector, blackhole);
return null;
}).toList();
blackhole.consume(results);
}
Aggregations