Fix 00606_quantiles_and_nans test

This commit is contained in:
alesapin 2018-08-13 18:02:23 +03:00
parent 9b65c5f6c5
commit d6fbf23e9d

View File

@ -1 +1,16 @@
SELECT DISTINCT eq FROM (WITH range(number % 10) AS arr, 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, arrayReduce('quantileExact', arr_with_nan) AS q1, arrayReduce('quantileExact', arr_filtered) AS q2, q1 = q2 AS eq FROM numbers(100));
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,
arrayReduce('quantileExact', arr_with_nan) AS q1,
arrayReduce('quantileExact', arr_filtered) AS q2,
q1 = q2 AS eq
FROM
numbers(100)
);