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

Memory limit should be respected.
}
    /** If the sources from the table were processed before some non-initial stage of query execution,
      * then sources from the buffers must also be wrapped in the processing pipeline before the same stage.
      */
    if (processed_stage > QueryProcessingStage::FetchColumns)
        pipe_from_buffers = QueryPipeline::getPipe(
                InterpreterSelectQuery(query_info.query, context, std::move(pipe_from_buffers),
                                               SelectQueryOptions(processed_stage)).execute().pipeline);
    if (query_info.prewhere_info)
    {
        pipe_from_buffers.addSimpleTransform([&](const Block & header)
        {
            return std::make_shared<FilterTransform>(
                    header, query_info.prewhere_info->prewhere_actions,
                    query_info.prewhere_info->prewhere_column_name, query_info.prewhere_info->remove_prewhere_column);
        });
        if (query_info.prewhere_info->alias_actions)
        {
            pipe_from_buffers.addSimpleTransform([&](const Block & header)
            {
                return std::make_shared<ExpressionTransform>(header, query_info.prewhere_info->alias_actions);
            });
        }
    }
    Pipes pipes;
    pipes.emplace_back(std::move(pipe_from_dst));
    pipes.emplace_back(std::move(pipe_from_buffers));
    return Pipe::unitePipes(std::move(pipes));
}
static void appendBlock(const Block & from, Block & to)