Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine merge agg stream #6793

Merged
merged 18 commits into from
Feb 14, 2023
13 changes: 12 additions & 1 deletion dbms/src/DataStreams/AggregatingBlockInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <DataStreams/AggregatingBlockInputStream.h>
#include <DataStreams/MergingAggregatedMemoryEfficientBlockInputStream.h>
#include <DataStreams/MergingAndConvertingBlockInputStream.h>
#include <DataStreams/NullBlockInputStream.h>

namespace DB
{
Expand Down Expand Up @@ -41,7 +43,16 @@ Block AggregatingBlockInputStream::readImpl()
if (!aggregator.hasSpilledData())
{
ManyAggregatedDataVariants many_data{data_variants};
impl = aggregator.mergeAndConvertToBlocks(many_data, final, 1);
auto merging_buckets = aggregator.mergeAndConvertToBlocks(many_data, final, 1);
if (!merging_buckets)
{
impl = std::make_unique<NullBlockInputStream>(aggregator.getHeader(final));
}
else
{
RUNTIME_CHECK(1 == merging_buckets->getConcurrency());
impl = std::make_unique<MergingAndConvertingBlockInputStream>(merging_buckets, 0, log->identifier());
}
}
else
{
Expand Down
55 changes: 0 additions & 55 deletions dbms/src/DataStreams/MergingAggregatedBlockInputStream.cpp

This file was deleted.

58 changes: 0 additions & 58 deletions dbms/src/DataStreams/MergingAggregatedBlockInputStream.h

This file was deleted.

Loading