partialAggregation.addInput(createGroupByIdBlock(0, page.getPositionCount()), page);
}
BlockBuilder partialOut = new BlockBuilder(partialAggregation.getIntermediateTupleInfo());
partialAggregation.evaluateIntermediate(0, partialOut);
UncompressedBlock partialBlock = partialOut.build();
GroupedAccumulator finalAggregation = function.createGroupedIntermediateAggregation(confidence);
// Add an empty block to test the handling of empty intermediates
GroupedAccumulator emptyAggregation = function.createGroupedAggregation(Optional.<Integer>absent(), Optional.<Integer>absent(), confidence, args);
BlockBuilder emptyOut = new BlockBuilder(emptyAggregation.getIntermediateTupleInfo());
emptyAggregation.evaluateIntermediate(0, emptyOut);
UncompressedBlock emptyBlock = emptyOut.build();
finalAggregation.addIntermediate(createGroupByIdBlock(0, emptyBlock.getPositionCount()), emptyBlock);
finalAggregation.addIntermediate(createGroupByIdBlock(0, partialBlock.getPositionCount()), partialBlock);
return getGroupValue(finalAggregation, 0);
}