presto-main/src/main/java/io/prestosql/operator/aggregation/state/BlockPositionStateSerializer.java/BlockPositionStateSerializer/serialize
class BlockPositionStateSerializer:    @Override
    public void serialize(BlockPositionState state, BlockBuilder out)
    {
        if (state.getBlock() == null) {
            out.appendNull();
        }
        else {
            type.appendTo(state.getBlock(), state.getPosition(), out);
        }
    }