@Override
public void addInput(GroupByIdBlock groupIdsBlock, Page page)
{
counts.ensureCapacity(groupIdsBlock.getGroupCount());
samples.ensureCapacity(groupIdsBlock.getGroupCount());
Block masks = null;
if (maskChannel.isPresent()) {
masks = page.getBlock(maskChannel.get());
}
Block sampleWeights = page.getBlock(sampleWeightChannel);
for (int position = 0; position < groupIdsBlock.getPositionCount(); position++) {
long groupId = groupIdsBlock.getGroupId(position);
long weight = ApproximateUtils.computeSampleWeight(masks, sampleWeights, position);
counts.add(groupId, weight);