use of io.druid.query.ColumnSelectorPlus in project druid by druid-io.
the class CardinalityAggregatorTest method testBufferAggregateValues.
@Test
public void testBufferAggregateValues() throws Exception {
CardinalityBufferAggregator agg = new CardinalityBufferAggregator(dimInfoList.toArray(new ColumnSelectorPlus[] {}), false);
int maxSize = valueAggregatorFactory.getMaxIntermediateSize();
ByteBuffer buf = ByteBuffer.allocate(maxSize + 64);
int pos = 10;
buf.limit(pos + maxSize);
agg.init(buf, pos);
for (int i = 0; i < values1.size(); ++i) {
bufferAggregate(selectorList, agg, buf, pos);
}
Assert.assertEquals(7.0, (Double) valueAggregatorFactory.finalizeComputation(agg.get(buf, pos)), 0.05);
}
Aggregations