use of org.apache.druid.segment.RowNumCounter in project druid by druid-io.
the class IncrementalIndexRowIterator method makeRowPointer.
private static RowPointer makeRowPointer(IncrementalIndex incrementalIndex, IncrementalIndexRowHolder rowHolder, RowNumCounter rowNumCounter) {
ColumnSelectorFactory columnSelectorFactory = new IncrementalIndexColumnSelectorFactory(new IncrementalIndexStorageAdapter(incrementalIndex), VirtualColumns.EMPTY, false, rowHolder);
ColumnValueSelector[] dimensionSelectors = incrementalIndex.getDimensions().stream().map(dim -> {
ColumnValueSelector selectorWithUnsortedValues = columnSelectorFactory.makeColumnValueSelector(dim.getName());
return dim.getIndexer().convertUnsortedValuesToSorted(selectorWithUnsortedValues);
}).toArray(ColumnValueSelector[]::new);
List<DimensionHandler> dimensionHandlers = incrementalIndex.getDimensions().stream().map(IncrementalIndex.DimensionDesc::getHandler).collect(Collectors.toList());
ColumnValueSelector[] metricSelectors = incrementalIndex.getMetricNames().stream().map(columnSelectorFactory::makeColumnValueSelector).toArray(ColumnValueSelector[]::new);
return new RowPointer(rowHolder, dimensionSelectors, dimensionHandlers, metricSelectors, incrementalIndex.getMetricNames(), rowNumCounter);
}
Aggregations