add tests

This commit is contained in:
RedClusive 2021-04-25 21:49:02 +00:00
parent dbb0a4aab7
commit 907115a4c4
6 changed files with 72 additions and 4 deletions

View File

@ -10,7 +10,9 @@
[30000]
30000
[30000]
2016-06-15 23:01:04
['2016-06-15 23:01:04']
2016-06-15 23:01:04
['2016-06-15 23:01:04']
2016-06-15 23:00:16
['2016-06-15 23:00:16']
2016-06-15 23:00:16
['2016-06-15 23:00:16']
2016-04-02 17:23:12
['2016-04-02 17:23:12']

View File

@ -27,4 +27,7 @@ SELECT quantilesTDigest(0.2)(d) FROM datetime;
SELECT quantileTDigestWeighted(0.2)(d, 1) FROM datetime;
SELECT quantilesTDigestWeighted(0.2)(d, 1) FROM datetime;
SELECT quantileBfloat16(0.2)(d) FROM datetime;
SELECT quantilesBfloat16(0.2)(d) FROM datetime;
DROP TABLE datetime;

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,16 @@
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('quantileBfloat16', arr_with_nan) AS q1,
arrayReduce('quantileBfloat16', arr_filtered) AS q2,
q1 = q2 AS eq
FROM
numbers(100)
);

View File

@ -0,0 +1,40 @@
1704509 1384
732797 1336
598875 1384
792887 1336
3807842 1336
25703952 1336
716829 1384
59183 1336
33010362 1336
800784 1336
1704509 [1296,1384,1840,1960,3696]
732797 [1232,1336,1840,1944,3664]
598875 [1232,1384,1840,1944,3536]
792887 [1296,1336,1840,1888,3696]
3807842 [1232,1336,1840,1936,2032]
25703952 [1012,1336,1840,1944,3696]
716829 [1232,1384,1840,1944,3696]
59183 [316,1336,1840,2008,2032]
33010362 [1232,1336,1840,1936,2032]
800784 [1232,1336,1840,1928,2032]
1704509 1384
732797 1336
598875 1384
792887 1336
3807842 1336
25703952 1336
716829 1384
59183 1336
33010362 1336
800784 1336
1704509 [1296,1384,1840,1960,3696]
732797 [1232,1336,1840,1944,3664]
598875 [1232,1384,1840,1944,3536]
792887 [1296,1336,1840,1888,3696]
3807842 [1232,1336,1840,1936,2032]
25703952 [1012,1336,1840,1944,3696]
716829 [1232,1384,1840,1944,3696]
59183 [316,1336,1840,2008,2032]
33010362 [1232,1336,1840,1936,2032]
800784 [1232,1336,1840,1928,2032]

View File

@ -0,0 +1,6 @@
SELECT CounterID AS k, quantileBfloat16(0.5)(ResolutionWidth) FROM test.hits GROUP BY k ORDER BY count() DESC, CounterID LIMIT 10;
SELECT CounterID AS k, quantilesBfloat16(0.1, 0.5, 0.9, 0.99, 0.999)(ResolutionWidth) FROM test.hits GROUP BY k ORDER BY count() DESC, CounterID LIMIT 10;
SELECT CounterID AS k, quantileBfloat16(0.5)(ResolutionWidth) FROM remote('127.0.0.{1,2}', test.hits) GROUP BY k ORDER BY count() DESC, CounterID LIMIT 10;
SELECT CounterID AS k, quantilesBfloat16(0.1, 0.5, 0.9, 0.99, 0.999)(ResolutionWidth) FROM remote('127.0.0.{1,2}', test.hits) GROUP BY k ORDER BY count() DESC, CounterID LIMIT 10;