ClickHouse/tests/queries/0_stateless/01813_quantileBfloat16_nans.sql

17 lines
531 B
MySQL
Raw Normal View History

2021-04-25 21:49:02 +00:00
SELECT DISTINCT
eq
FROM
(
WITH
range(2 + number % 10) AS arr, -- minimum two elements, to avoid nan result --
arrayMap(x -> x = intDiv(number, 10) ? nan : x, arr) AS arr_with_nan,
arrayFilter(x -> x != intDiv(number, 10), arr) AS arr_filtered
SELECT
number,
2021-04-26 09:39:08 +00:00
arrayReduce('quantileBFloat16', arr_with_nan) AS q1,
arrayReduce('quantileBFloat16', arr_filtered) AS q2,
2021-04-25 21:49:02 +00:00
q1 = q2 AS eq
FROM
numbers(100)
);