presto-main/src/main/java/io/prestosql/operator/unnest/ReplicatedBlockBuilder.java/ReplicatedBlockBuilder/appendRepeated
class ReplicatedBlockBuilder:    public void appendRepeated(int index, int count)
    {
        checkState(source != null, "source is null");
        checkElementIndex(index, source.getPositionCount());
        checkArgument(count >= 0, "count should be >= 0");

        if (positionCount + count > ids.length) {
            // Grow capacity
            int newSize = Math.max(calculateNewArraySize(ids.length), positionCount + count);
            ids = Arrays.copyOf(ids, newSize);
        }

        Arrays.fill(ids, positionCount, positionCount + count, index);
        positionCount += count;
    }