ClickHouse/tests/queries/0_stateless/01576_if_null_external_aggregation.sql
Azat Khuzhin 7da4083237 Forbid bit functions for floats
This will fix the following UB report [1]:

  "../src/Functions/bitAnd.cpp:24:61: runtime error: nan is outside the
range of representable values of type 'long' Received signal -3 Received
signal Unknown signal (-3)"

  [1]: https://clickhouse-test-reports.s3.yandex.net/19824/89c4055202b9d08459f90ee5791d4e3017b82fbf/fuzzer_ubsan/report.html#fail1
2021-01-30 09:12:31 +03:00

8 lines
289 B
SQL

SET max_bytes_before_external_group_by = 200000000;
SET max_memory_usage = 1500000000;
SET max_threads = 12;
SELECT bitAnd(number, toUInt64(pow(2, 20) - 1)) as k, argMaxIf(k, number % 2 = 0 ? number : Null, number > 42), uniq(number) AS u FROM numbers(1000000) GROUP BY k format Null;