mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Fix optimize_aggregation_in_order in case of empty result set
Note, that this is not complete fix, see the next two patches. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
f3359b4698
commit
d9a64d1f86
@ -23,7 +23,11 @@ void MergingAggregatedTransform::consume(Chunk chunk)
|
|||||||
LOG_TRACE(log, "Reading blocks of partially aggregated data.");
|
LOG_TRACE(log, "Reading blocks of partially aggregated data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
total_input_rows += chunk.getNumRows();
|
size_t input_rows = chunk.getNumRows();
|
||||||
|
if (!input_rows)
|
||||||
|
return;
|
||||||
|
|
||||||
|
total_input_rows += input_rows;
|
||||||
++total_input_blocks;
|
++total_input_blocks;
|
||||||
|
|
||||||
const auto & info = chunk.getChunkInfo();
|
const auto & info = chunk.getChunkInfo();
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
-- { echoOn }
|
||||||
|
|
||||||
|
-- regression for optimize_aggregation_in_order with empty result set
|
||||||
|
-- that cause at first
|
||||||
|
-- "Chunk should have AggregatedChunkInfo in GroupingAggregatedTransform"
|
||||||
|
-- at first and after
|
||||||
|
-- "Chunk should have AggregatedChunkInfo in GroupingAggregatedTransform"
|
||||||
|
select count() from remote('127.{1,2}', currentDatabase(), data_02176) where key = 0 group by key settings optimize_aggregation_in_order=1;
|
@ -0,0 +1,14 @@
|
|||||||
|
drop table if exists data_02176;
|
||||||
|
create table data_02176 (key Int) Engine=MergeTree() order by key;
|
||||||
|
|
||||||
|
-- { echoOn }
|
||||||
|
|
||||||
|
-- regression for optimize_aggregation_in_order with empty result set
|
||||||
|
-- that cause at first
|
||||||
|
-- "Chunk should have AggregatedChunkInfo in GroupingAggregatedTransform"
|
||||||
|
-- at first and after
|
||||||
|
-- "Chunk should have AggregatedChunkInfo in GroupingAggregatedTransform"
|
||||||
|
select count() from remote('127.{1,2}', currentDatabase(), data_02176) where key = 0 group by key settings optimize_aggregation_in_order=1;
|
||||||
|
|
||||||
|
-- { echoOff }
|
||||||
|
drop table data_02176;
|
Loading…
Reference in New Issue
Block a user