Search in sources :

Example 1 with TopNColumnSelectorStrategy

use of io.druid.query.topn.types.TopNColumnSelectorStrategy in project druid by druid-io.

the class DimExtractionTopNAlgorithm method scanAndAggregate.

@Override
public void scanAndAggregate(TopNParams params, Aggregator[][] rowSelector, Map<Comparable, Aggregator[]> aggregatesStore, int numProcessed) {
    final Cursor cursor = params.getCursor();
    final ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus();
    selectorPlus.getColumnSelectorStrategy().dimExtractionScanAndAggregate(query, selectorPlus.getSelector(), cursor, rowSelector, aggregatesStore);
}
Also used : TopNColumnSelectorStrategy(io.druid.query.topn.types.TopNColumnSelectorStrategy) Cursor(io.druid.segment.Cursor)

Example 2 with TopNColumnSelectorStrategy

use of io.druid.query.topn.types.TopNColumnSelectorStrategy in project druid by druid-io.

the class DimExtractionTopNAlgorithm method needsResultTypeConversion.

private boolean needsResultTypeConversion(TopNParams params) {
    ColumnSelectorPlus<TopNColumnSelectorStrategy> selectorPlus = params.getSelectorPlus();
    TopNColumnSelectorStrategy strategy = selectorPlus.getColumnSelectorStrategy();
    return query.getDimensionSpec().getOutputType() != strategy.getValueType();
}
Also used : TopNColumnSelectorStrategy(io.druid.query.topn.types.TopNColumnSelectorStrategy)

Aggregations

TopNColumnSelectorStrategy (io.druid.query.topn.types.TopNColumnSelectorStrategy)2 Cursor (io.druid.segment.Cursor)1