ClickHouse/tests/queries/0_stateless/02661_quantile_approx.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
2.2 KiB
MySQL
Raw Normal View History

2023-03-07 10:27:02 +00:00
-- { echoOn }
2023-03-07 09:54:21 +00:00
with arrayJoin([0, 1, 2, 10]) as x select quantilesApprox(100, 0.5, 0.4, 0.1)(x);
with arrayJoin([0, 6, 7, 9, 10]) as x select quantileApprox(100, 0.5)(x);
select quantilesApprox(10000, 0.25, 0.5, 0.75, 0.0, 1.0, 0, 1)(number + 1) from numbers(1000);
select quantilesApprox(10000, 0.01, 0.1, 0.11)(number + 1) from numbers(10);
with number + 1 as col select quantilesApprox(10000, 0.25, 0.5, 0.75)(col), count(col), quantilesApprox(10000, 0.0, 1.0)(col), sum(col) from numbers(1000);
select quantilesApprox(1, 100/1000, 200/1000, 250/1000, 314/1000, 777/1000)(number + 1) from numbers(1000);
select quantilesApprox(10, 100/1000, 200/1000, 250/1000, 314/1000, 777/1000)(number + 1) from numbers(1000);
select quantilesApprox(100, 100/1000, 200/1000, 250/1000, 314/1000, 777/1000)(number + 1) from numbers(1000);
select quantilesApprox(1000, 100/1000, 200/1000, 250/1000, 314/1000, 777/1000)(number + 1) from numbers(1000);
select quantilesApprox(10000, 100/1000, 200/1000, 250/1000, 314/1000, 777/1000)(number + 1) from numbers(1000);
2023-03-07 10:27:02 +00:00
select quantileApprox()(number) from numbers(10); -- { serverError BAD_ARGUMENTS }
select quantileApprox(100)(number) from numbers(10);
select quantileApprox(100, 0.5)(number) from numbers(10);
select quantileApprox(100, 0.5, 0.75)(number) from numbers(10); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
select quantileApprox('abc', 0.5)(number) from numbers(10); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
select quantileApprox(1.23, 0.5)(number) from numbers(10); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
select quantileApprox(-100, 0.5)(number) from numbers(10); -- { serverError BAD_ARGUMENTS }
2023-03-07 09:54:21 +00:00
2023-03-07 10:27:02 +00:00
select quantilesApprox()(number) from numbers(10); -- { serverError BAD_ARGUMENTS }
select quantilesApprox(100)(number) from numbers(10); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
select quantilesApprox(100, 0.5)(number) from numbers(10);
select quantilesApprox('abc', 0.5, 0.75)(number) from numbers(10); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
select quantilesApprox(1.23, 0.5, 0.75)(number) from numbers(10); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
select quantilesApprox(-100, 0.5, 0.75)(number) from numbers(10); -- { serverError BAD_ARGUMENTS }
-- { echoOff }