presto-spi/src/main/java/io/prestosql/spi/block/ArrayBlockBuilder.java/ArrayBlockBuilder/appendStructureInternal
class ArrayBlockBuilder:    @Override
    public BlockBuilder appendStructureInternal(Block block, int position)
    {
        if (!(block instanceof AbstractArrayBlock)) {
            throw new IllegalArgumentException();
        }

        AbstractArrayBlock arrayBlock = (AbstractArrayBlock) block;
        BlockBuilder entryBuilder = beginBlockEntry();

        int startValueOffset = arrayBlock.getOffset(position);
        int endValueOffset = arrayBlock.getOffset(position + 1);
        for (int i = startValueOffset; i < endValueOffset; i++) {
            if (arrayBlock.getRawElementBlock().isNull(i)) {
                entryBuilder.appendNull();
            }
            else {
                arrayBlock.getRawElementBlock().writePositionTo(i, entryBuilder);
            }
        }

        closeEntry();
        return this;
    }