use of org.apache.druid.query.aggregation.cardinality.vector.FloatCardinalityVectorProcessor in project druid by druid-io.
the class CardinalityVectorAggregatorTest method testAggregateFloat.
@Test
public void testAggregateFloat() {
final float[] values = { 1, 2, 2, 3, 3, 3, 0 };
final boolean[] nulls = NullHandling.replaceWithDefault() ? null : new boolean[] { false, false, false, false, false, false, true };
final CardinalityVectorAggregator aggregator = new CardinalityVectorAggregator(Collections.singletonList(new FloatCardinalityVectorProcessor(new BaseFloatVectorValueSelector(new NoFilterVectorOffset(values.length, 0, values.length)) {
@Override
public float[] getFloatVector() {
return values;
}
@Nullable
@Override
public boolean[] getNullVector() {
return nulls;
}
})));
testAggregate(aggregator, values.length, NullHandling.replaceWithDefault() ? 4 : 3);
}
Aggregations