mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
Do not return empty blocks from ConvertingAggregatedToChunksTransform
(#41152)
* impl * add test * update test
This commit is contained in:
parent
6e77751581
commit
6f186d3dd2
@ -248,8 +248,11 @@ private:
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Some ready chunks expected");
|
||||
|
||||
auto & output = outputs.front();
|
||||
output.push(std::move(single_level_chunks.back()));
|
||||
auto chunk = std::move(single_level_chunks.back());
|
||||
single_level_chunks.pop_back();
|
||||
const auto has_rows = chunk.hasRows();
|
||||
if (has_rows)
|
||||
output.push(std::move(chunk));
|
||||
|
||||
if (finished && single_level_chunks.empty())
|
||||
{
|
||||
@ -257,7 +260,7 @@ private:
|
||||
return Status::Finished;
|
||||
}
|
||||
|
||||
return Status::PortFull;
|
||||
return has_rows ? Status::PortFull : Status::Ready;
|
||||
}
|
||||
|
||||
/// Read all sources and try to push current bucket.
|
||||
@ -281,7 +284,10 @@ private:
|
||||
if (!two_level_chunks[current_bucket_num])
|
||||
return Status::NeedData;
|
||||
|
||||
output.push(std::move(two_level_chunks[current_bucket_num]));
|
||||
auto chunk = std::move(two_level_chunks[current_bucket_num]);
|
||||
const auto has_rows = chunk.hasRows();
|
||||
if (has_rows)
|
||||
output.push(std::move(chunk));
|
||||
|
||||
++current_bucket_num;
|
||||
if (current_bucket_num == NUM_BUCKETS)
|
||||
@ -291,7 +297,7 @@ private:
|
||||
return Status::Finished;
|
||||
}
|
||||
|
||||
return Status::PortFull;
|
||||
return has_rows ? Status::PortFull : Status::Ready;
|
||||
}
|
||||
|
||||
AggregatingTransformParamsPtr params;
|
||||
|
@ -0,0 +1,6 @@
|
||||
┌─[1mnumber[0m─┐
|
||||
│ 42 │
|
||||
└────────┘
|
||||
┌─[1mnumber[0m─┐
|
||||
│ 42 │
|
||||
└────────┘
|
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ue
|
||||
|
||||
unset CLICKHOUSE_LOG_COMMENT
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
${CLICKHOUSE_CURL} \
|
||||
$CLICKHOUSE_URL \
|
||||
--get \
|
||||
--data-urlencode "query=
|
||||
select number
|
||||
from numbers_mt(1e6)
|
||||
where number = 42
|
||||
group by number
|
||||
settings max_threads = 10, max_bytes_before_external_group_by = 1, group_by_two_level_threshold = 1
|
||||
format PrettyCompact"
|
||||
|
||||
${CLICKHOUSE_CURL} \
|
||||
$CLICKHOUSE_URL \
|
||||
--get \
|
||||
--data-urlencode "query=
|
||||
select number
|
||||
from numbers_mt(1e6)
|
||||
where number = 42
|
||||
group by number
|
||||
settings max_threads = 10, max_bytes_before_external_group_by = 0, group_by_two_level_threshold = 1
|
||||
format PrettyCompact"
|
Loading…
Reference in New Issue
Block a user