@Override
public void addInput(Page page)
{
checkArgument(valueChannel != -1, "Raw input is not allowed for a final aggregation");
BlockCursor values = page.getBlock(valueChannel).cursor();
BlockCursor weights = page.getBlock(weightChannel).cursor();
BlockCursor percentiles = page.getBlock(percentileChannel).cursor();
BlockCursor masks = null;
if (maskChannel.isPresent()) {
masks = page.getBlock(maskChannel.get()).cursor();
}
for (int position = 0; position < page.getPositionCount(); position++) {
checkState(values.advanceNextPosition());
checkState(weights.advanceNextPosition());
checkState(percentiles.advanceNextPosition());
checkState(masks == null || masks.advanceNextPosition());
if (!values.isNull() && !weights.isNull() && (masks == null || masks.getBoolean())) {
addValue(digest, values, weights.getLong(), parameterType);
// use last non-null percentile
if (!percentiles.isNull()) {
percentile = percentiles.getDouble();