mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 11:22:12 +00:00
6 lines
440 B
SQL
6 lines
440 B
SQL
-- Disable external aggregation because the state is reset for each new block of data in 'runningAccumulate' function.
|
|
SET max_bytes_before_external_group_by = 0;
|
|
SET allow_deprecated_error_prone_window_functions = 1;
|
|
|
|
SELECT k, finalizeAggregation(sum_state), runningAccumulate(sum_state) FROM (SELECT intDiv(number, 50000) AS k, sumState(number) AS sum_state FROM (SELECT number FROM system.numbers LIMIT 1000000) GROUP BY k ORDER BY k);
|