MaterializedResult expected = MaterializedResult.resultBuilder(function.getFinalTupleInfo())
.row(expectedValue)
.build();
// verify addValue(Page)
Aggregator aggregator1 = createAggregator(definition, Step.FINAL);
for (Page input : inputs) {
aggregator1.addValue(computePartial(function, input));
}
assertEquals(getResult(function.getFinalTupleInfo(), aggregator1), expected);
// verify addValue(BlockCursor...)
Aggregator aggregator2 = createAggregator(definition, Step.FINAL);
for (Page input : inputs) {
Page partial = computePartial(function, input);
BlockCursor[] cursors = new BlockCursor[partial.getBlocks().length];
for (int i = 0; i < cursors.length; i++) {
cursors[i] = partial.getBlock(i).cursor();
}
while (BlockAssertions.advanceAllCursorsToNextPosition(cursors)) {
aggregator2.addValue(cursors);
}
}
assertEquals(getResult(function.getFinalTupleInfo(), aggregator2), expected);
}