use of org.openjdk.jmh.infra.Blackhole in project druid by druid-io.
the class ExpressionSelectorBenchmark method strlenUsingExpressionAsString.
@Benchmark
public void strlenUsingExpressionAsString(Blackhole blackhole) {
final Sequence<Cursor> cursors = new QueryableIndexStorageAdapter(index).makeCursors(null, index.getDataInterval(), VirtualColumns.create(ImmutableList.of(new ExpressionVirtualColumn("v", "strlen(s)", ColumnType.STRING, TestExprMacroTable.INSTANCE))), Granularities.ALL, false, null);
final List<?> results = cursors.map(cursor -> {
final DimensionSelector selector = cursor.getColumnSelectorFactory().makeDimensionSelector(new DefaultDimensionSpec("v", "v", ColumnType.STRING));
consumeDimension(cursor, selector, blackhole);
return null;
}).toList();
blackhole.consume(results);
}
use of org.openjdk.jmh.infra.Blackhole 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.openjdk.jmh.infra.Blackhole 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);
}
use of org.openjdk.jmh.infra.Blackhole in project druid by druid-io.
the class ExpressionFilterBenchmark method nativeFilter.
@Benchmark
public void nativeFilter(Blackhole blackhole) {
final Sequence<Cursor> cursors = new QueryableIndexStorageAdapter(index).makeCursors(nativeFilter.toFilter(), index.getDataInterval(), VirtualColumns.EMPTY, Granularities.ALL, false, null);
final List<?> results = cursors.map(cursor -> {
final ColumnValueSelector selector = cursor.getColumnSelectorFactory().makeColumnValueSelector("x");
consumeString(cursor, selector, blackhole);
return null;
}).toList();
blackhole.consume(results);
}
use of org.openjdk.jmh.infra.Blackhole in project druid by druid-io.
the class ExpressionFilterBenchmark method expressionFilter.
@Benchmark
public void expressionFilter(Blackhole blackhole) {
final Sequence<Cursor> cursors = new QueryableIndexStorageAdapter(index).makeCursors(expressionFilter.toFilter(), index.getDataInterval(), VirtualColumns.EMPTY, Granularities.ALL, false, null);
final List<?> results = cursors.map(cursor -> {
final ColumnValueSelector selector = cursor.getColumnSelectorFactory().makeColumnValueSelector("x");
consumeString(cursor, selector, blackhole);
return null;
}).toList();
blackhole.consume(results);
}
Aggregations