for (int position = 0; position < page.getPositionCount(); position++) {
// get the group for the current row
int groupId = putIfAbsent(position, blocks);
// output the group id for this row
blockBuilder.appendLong(groupId);
}
Block block = blockBuilder.build();
return new GroupByIdBlock(nextGroupId, block);
}