mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
37 lines
728 B
C++
37 lines
728 B
C++
#include <Columns/ColumnsNumber.h>
|
|
|
|
#include <DataStreams/MergingAggregatedBlockInputStream.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
|
|
Block MergingAggregatedBlockInputStream::readImpl()
|
|
{
|
|
if (!executed)
|
|
{
|
|
executed = true;
|
|
AggregatedDataVariants data_variants;
|
|
|
|
Aggregator::CancellationHook hook = [&]() { return this->isCancelled(); };
|
|
aggregator.setCancellationHook(hook);
|
|
|
|
aggregator.mergeStream(children.back(), data_variants, max_threads);
|
|
blocks = aggregator.convertToBlocks(data_variants, final, max_threads);
|
|
it = blocks.begin();
|
|
}
|
|
|
|
Block res;
|
|
if (isCancelled() || it == blocks.end())
|
|
return res;
|
|
|
|
res = std::move(*it);
|
|
++it;
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
}
|