**Describe the bug**
`SELECT i FROM generateRandom('i Array(Int8)', 1048575, 10, 1048577) LIMIT 1048575`

Memory limit should be respected.
pipe_from_dst.addSimpleTransform([&](const Block & stream_header)
                    {
                        return std::make_shared<ConvertingTransform>(
                            stream_header, header, ConvertingTransform::MatchColumnsMode::Name);
                    });
                }
            }
        }
        pipe_from_dst.addTableLock(destination_lock);
        pipe_from_dst.addStorageHolder(destination);
    }
    Pipe pipe_from_buffers;
    {
        Pipes pipes_from_buffers;
        pipes_from_buffers.reserve(num_shards);
        for (auto & buf : buffers)
            pipes_from_buffers.emplace_back(std::make_shared<BufferSource>(column_names, buf, *this, metadata_snapshot));
        pipe_from_buffers = Pipe::unitePipes(std::move(pipes_from_buffers));
    }
    
    if (!pipe_from_buffers.empty() && !pipe_from_dst.empty()
        && !blocksHaveEqualStructure(pipe_from_buffers.getHeader(), pipe_from_dst.getHeader()))
    {
        pipe_from_dst.addSimpleTransform([&](const Block & header)
        {
            return std::make_shared<ConvertingTransform>(
                   header,
                   pipe_from_buffers.getHeader(),
                   ConvertingTransform::MatchColumnsMode::Name);
        });