mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Fix only_merge header
This commit is contained in:
parent
d73f975849
commit
53f47127e9
@ -374,7 +374,15 @@ Block Aggregator::Params::getHeader(
|
||||
|
||||
if (only_merge)
|
||||
{
|
||||
res = header.cloneEmpty();
|
||||
NameSet needed_columns(keys.begin(), keys.end());
|
||||
for (const auto & aggregate : aggregates)
|
||||
needed_columns.emplace(aggregate.column_name);
|
||||
|
||||
for (const auto & column : header)
|
||||
{
|
||||
if (needed_columns.contains(column.name))
|
||||
res.insert(column.cloneEmpty());
|
||||
}
|
||||
|
||||
if (final)
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
0 9998 5000
|
||||
1 9999 5000
|
||||
0 9998 5000
|
||||
0 9998 5000
|
||||
1
|
||||
0 9998 5000
|
||||
0
|
||||
@ -15,6 +16,7 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
2021-10-25 10:00:00 3 2021-10-27 10:00:00 3
|
||||
\N 2021-10-27 10:00:00 3
|
||||
0
|
||||
2021-10-24 10:00:00
|
||||
|
@ -10,6 +10,7 @@ set max_rows_to_read = 2, allow_experimental_projection_optimization = 1;
|
||||
select min(i), max(i), count() from d;
|
||||
select min(i), max(i), count() from d group by _partition_id order by _partition_id;
|
||||
select min(i), max(i), count() from d where _partition_value.1 = 0 group by _partition_id order by _partition_id;
|
||||
select min(i), max(i), count() from d where moduloLegacy(i, 2) = 0 group by _partition_id order by _partition_id;
|
||||
select min(i), max(i), count() from d where _partition_value.1 = 10 group by _partition_id order by _partition_id;
|
||||
|
||||
-- fuzz crash
|
||||
@ -57,6 +58,9 @@ select min(dt), max(dt), count() from d where toDate(dt) >= '2021-10-25';
|
||||
select min(dt), max(dt), count(toDate(dt) >= '2021-10-25') from d where toDate(dt) >= '2021-10-25';
|
||||
select count() from d group by toDate(dt);
|
||||
|
||||
-- fuzz crash
|
||||
SELECT min(dt), count(ignore(ignore(ignore(tupleElement(_partition_value, NULL) = NULL), NULL, NULL, NULL), 0, '10485.76', NULL)), max(dt), count(toDate(dt) >= '2021-10-25') FROM d WHERE toDate(dt) >= '2021-10-25';
|
||||
|
||||
-- fuzz crash
|
||||
SELECT pointInEllipses(min(j), NULL), max(dt), count('0.0000000007') FROM d WHERE toDate(dt) >= '2021-10-25';
|
||||
SELECT min(j) FROM d PREWHERE ceil(j) <= 0;
|
||||
|
Loading…
Reference in New Issue
Block a user