diff --git a/src/Interpreters/Aggregator.cpp b/src/Interpreters/Aggregator.cpp index f0e64b5cbcfa..e4856c33988c 100644 --- a/src/Interpreters/Aggregator.cpp +++ b/src/Interpreters/Aggregator.cpp @@ -1797,8 +1797,8 @@ void Aggregator::writeToTemporaryFile(AggregatedDataVariants & data_variants, si rows, ReadableSize(uncompressed_size), ReadableSize(compressed_size), - static_cast(uncompressed_size) / rows, - static_cast(compressed_size) / rows, + rows ? static_cast(uncompressed_size) / rows : 0.0, + rows ? static_cast(compressed_size) / rows : 0.0, static_cast(uncompressed_size) / compressed_size, static_cast(rows) / elapsed_seconds, ReadableSize(static_cast(uncompressed_size) / elapsed_seconds), diff --git a/tests/queries/0_stateless/00089_group_by_arrays_of_fixed.sql b/tests/queries/0_stateless/00089_group_by_arrays_of_fixed.sql index 60ec1cb3396a..a068671b999d 100644 --- a/tests/queries/0_stateless/00089_group_by_arrays_of_fixed.sql +++ b/tests/queries/0_stateless/00089_group_by_arrays_of_fixed.sql @@ -1 +1 @@ -SELECT arr, count() AS c FROM (SELECT arrayMap(x -> x % 2, groupArray(number)) AS arr FROM (SELECT number FROM system.numbers LIMIT 10000) GROUP BY number % ((number * 0xABCDEF0123456789 % 1234) + 1)) GROUP BY arr ORDER BY c DESC, arr ASC; +SELECT arr, count() AS c FROM (SELECT arrayMap(x -> x % 2, arraySort(groupArray(number))) AS arr FROM (SELECT number FROM system.numbers LIMIT 10000) GROUP BY number % ((number * 0xABCDEF0123456789 % 1234) + 1)) GROUP BY arr ORDER BY c DESC, arr ASC; \ No newline at end of file