use of org.apache.druid.query.aggregation.AggregateCombiner in project druid by druid-io.
the class StringLastAggregationTest method testStringLastAggregateCombiner.
@Test
public void testStringLastAggregateCombiner() {
TestObjectColumnSelector columnSelector = new TestObjectColumnSelector<>(pairs);
AggregateCombiner stringFirstAggregateCombiner = combiningAggFactory.makeAggregateCombiner();
stringFirstAggregateCombiner.reset(columnSelector);
Assert.assertEquals(pairs[0], stringFirstAggregateCombiner.getObject());
columnSelector.increment();
stringFirstAggregateCombiner.fold(columnSelector);
Assert.assertEquals(pairs[1], stringFirstAggregateCombiner.getObject());
stringFirstAggregateCombiner.reset(columnSelector);
Assert.assertEquals(pairs[1], stringFirstAggregateCombiner.getObject());
}
use of org.apache.druid.query.aggregation.AggregateCombiner in project druid by druid-io.
the class StringFirstAggregationTest method testStringFirstAggregateCombiner.
@Test
public void testStringFirstAggregateCombiner() {
TestObjectColumnSelector columnSelector = new TestObjectColumnSelector<>(pairs);
AggregateCombiner stringFirstAggregateCombiner = combiningAggFactory.makeAggregateCombiner();
stringFirstAggregateCombiner.reset(columnSelector);
Assert.assertEquals(pairs[0], stringFirstAggregateCombiner.getObject());
columnSelector.increment();
stringFirstAggregateCombiner.fold(columnSelector);
Assert.assertEquals(pairs[0], stringFirstAggregateCombiner.getObject());
stringFirstAggregateCombiner.reset(columnSelector);
Assert.assertEquals(pairs[1], stringFirstAggregateCombiner.getObject());
}
Aggregations