ClickHouse/tests/queries/0_stateless/01865_aggregator_overflow_row.sql
Azat Khuzhin f1aebbe927 Check that totals correctly calculated in 01865_aggregator_overflow_row
Change aggregation function to uniqCombined() to check this.
2021-05-08 20:43:01 +03:00

21 lines
595 B
SQL

SELECT uniqCombined(number)
FROM numbers(10000)
GROUP BY number
WITH TOTALS
ORDER BY number DESC
LIMIT 10
SETTINGS
/* force aggregates serialization to trigger the issue with */
max_bytes_before_external_group_by=1,
/* overflow row: */
max_rows_to_group_by=10000000000,
group_by_overflow_mode='any',
totals_mode='before_having',
/* this is to account memory under 4MB (for max_bytes_before_external_group_by) to use less rows */
max_untracked_memory=0,
group_by_two_level_threshold=10000,
/* explicitly */
max_block_size=1000,
max_threads=1
;