Merge pull request #21436 from azat/optimize_aggregation_in_order-log-fix

Fix logging for optimize_aggregation_in_order=1 (with small max_block_size)
This commit is contained in:
Alexander Kuzmenkov 2021-03-11 17:46:48 +03:00 committed by GitHub
commit a2bedd592e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -129,6 +129,7 @@ void AggregatingInOrderTransform::consume(Chunk chunk)
source_column = source_column->cut(key_begin, rows - key_begin);
current_chunk = Chunk(source_columns, rows - key_begin);
src_rows -= current_chunk.getNumRows();
block_end_reached = true;
need_generate = true;
cur_block_size = 0;

View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=trace
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
$CLICKHOUSE_CLIENT --optimize_aggregation_in_order=1 -nm -q "
drop table if exists data_01753;
create table data_01753 (key Int) engine=MergeTree() order by key as select * from numbers(8);
select * from data_01753 group by key settings max_block_size=1;
select * from data_01753 group by key settings max_block_size=1;
drop table data_01753;
" |& grep -F -c 'AggregatingInOrderTransform: Aggregated. 8 to 8 rows'