diff --git a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.reference b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.reference index 4338ddbb043..b4a55ae0d66 100644 --- a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.reference +++ b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.reference @@ -19,3 +19,11 @@ nan nan nan 0 +----quantile---- +45 +0 +nan +nan +nan +nan +nan diff --git a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql index dc82c991918..589e5d92aca 100644 --- a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql +++ b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql @@ -139,4 +139,17 @@ SELECT corr(x_value, y_value) FROM (SELECT x_value, y_value FROM test.series LIM SELECT round(abs(corr(x_value, y_value) - covarPop(x_value, y_value) / (stddevPop(x_value) * stddevPop(y_value))), 6) FROM test.series; +/* quantile AND quantileExact */ +SELECT '----quantile----'; + +SELECT quantileExactIf(number, number > 0) FROM numbers(90); + +SELECT quantileExactIf(number, number > 100) FROM numbers(90); +SELECT quantileExactIf(toFloat32(number) , number > 100) FROM numbers(90); +SELECT quantileExactIf(toFloat64(number) , number > 100) FROM numbers(90); + +SELECT quantileIf(number, number > 100) FROM numbers(90); +SELECT quantileIf(toFloat32(number) , number > 100) FROM numbers(90); +SELECT quantileIf(toFloat64(number) , number > 100) FROM numbers(90); + DROP TABLE test.series;