提交 39730bfc 编写于 作者: A Alexey Milovidov

Alternative implementation of #14043

上级 0b071211
......@@ -126,20 +126,27 @@ Pipe StorageMemory::read(
Pipes pipes;
BlocksList::iterator first = data.begin();
size_t offset = 0;
for (size_t stream = 0; stream < num_streams; ++stream)
{
BlocksList::iterator first = data.begin();
BlocksList::iterator last = data.begin();
std::advance(first, stream * size / num_streams);
std::advance(last, (stream + 1) * size / num_streams);
auto next = first;
while (offset < stream * size / num_streams)
{
++next;
++offset;
}
if (first == last)
if (first == next)
continue;
else
--last;
auto last = next;
--last;
pipes.emplace_back(std::make_shared<MemorySource>(column_names, first, last, *this, metadata_snapshot));
first = next;
}
return Pipe::unitePipes(std::move(pipes));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册