From d6fbf23e9d5598431cfdb7cfbd13de679d7d979e Mon Sep 17 00:00:00 2001 From: alesapin Date: Mon, 13 Aug 2018 18:02:23 +0300 Subject: [PATCH] Fix 00606_quantiles_and_nans test --- .../0_stateless/00606_quantiles_and_nans.sql | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dbms/tests/queries/0_stateless/00606_quantiles_and_nans.sql b/dbms/tests/queries/0_stateless/00606_quantiles_and_nans.sql index c89883e356b..5a2d2b45cf2 100644 --- a/dbms/tests/queries/0_stateless/00606_quantiles_and_nans.sql +++ b/dbms/tests/queries/0_stateless/00606_quantiles_and_nans.sql @@ -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)); \ No newline at end of file +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) + );