ClickHouse/dbms/tests/queries/0_stateless/00606_quantiles_and_nans.sql

17 lines
525 B
MySQL
Raw Normal View History

2018-08-13 15:02:23 +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
2018-08-13 15:03:53 +00:00
SELECT
number,
arrayReduce('quantileExact', arr_with_nan) AS q1,
arrayReduce('quantileExact', arr_filtered) AS q2,
q1 = q2 AS eq
FROM
numbers(100)
);