Add functional test for size parameter on groupUniqArray

This commit is contained in:
Guillaume Tassery 2019-04-15 17:09:01 +07:00
parent 803675892b
commit 3a23360e02
6 changed files with 60 additions and 3 deletions

View File

@ -18,3 +18,23 @@
1000 1000
1000 1000
1000 1000
10
10
10
10
10
10
10
10
10
10
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000

View File

@ -6,5 +6,7 @@ INSERT INTO test.group_uniq_str SELECT 5 as id, toString(number % 100) as v FROM
SELECT length(groupUniqArray(v)) FROM test.group_uniq_str GROUP BY id ORDER BY id; SELECT length(groupUniqArray(v)) FROM test.group_uniq_str GROUP BY id ORDER BY id;
SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', 'test', 'group_uniq_str') GROUP BY id ORDER BY id; SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', 'test', 'group_uniq_str') GROUP BY id ORDER BY id;
SELECT length(groupUniqArray(10)(v)) FROM test.group_uniq_str GROUP BY id ORDER BY id;
SELECT length(groupUniqArray(10000)(v)) FROM test.group_uniq_str GROUP BY id ORDER BY id;
DROP TABLE IF EXISTS test.group_uniq_str; DROP TABLE IF EXISTS test.group_uniq_str;

View File

@ -18,3 +18,23 @@
20001 20001
20001 20001
20001 20001
10
10
10
10
10
10
10
10
10
10
20001
20001
20001
20001
20001
20001
20001
20001
20001
20001

View File

@ -4,6 +4,10 @@ CREATE TABLE test.group_uniq_arr_int ENGINE = Memory AS
(SELECT intDiv(number%1000000, 100) as v, intDiv(number%100, 10) as g, number%10 as c FROM system.numbers WHERE c < 3 LIMIT 10000000); (SELECT intDiv(number%1000000, 100) as v, intDiv(number%100, 10) as g, number%10 as c FROM system.numbers WHERE c < 3 LIMIT 10000000);
SELECT length(groupUniqArray(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id; SELECT length(groupUniqArray(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id;
SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', 'test', 'group_uniq_arr_int') GROUP BY id ORDER BY id; SELECT length(groupUniqArray(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id;
--SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{2,3,4,5}', 'test', 'group_uniq_arr_int') GROUP BY id ORDER BY id;
SELECT length(groupUniqArray(10)(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id;
SELECT length(groupUniqArray(100000)(v)) FROM test.group_uniq_arr_int GROUP BY id ORDER BY id;
DROP TABLE IF EXISTS test.group_uniq_arr_int; DROP TABLE IF EXISTS test.group_uniq_arr_int;

View File

@ -1 +1,5 @@
['2016-12-16'] ['2016-12-16 12:00:00'] ['2016-12-16'] ['2016-12-16 12:00:00']
2 2 3 3
1 1 1 1
3 3
1 1

View File

@ -1,5 +1,12 @@
DROP TABLE IF EXISTS test.grop_uniq_array_date; DROP TABLE IF EXISTS test.grop_uniq_array_date;
CREATE TABLE test.grop_uniq_array_date (d Date, dt DateTime) ENGINE = Memory; CREATE TABLE test.grop_uniq_array_date (d Date, dt DateTime, id Integer) ENGINE = Memory;
INSERT INTO test.grop_uniq_array_date VALUES (toDate('2016-12-16'), toDateTime('2016-12-16 12:00:00')) (toDate('2016-12-16'), toDateTime('2016-12-16 12:00:00'));
INSERT INTO test.grop_uniq_array_date VALUES (toDate('2016-12-16'), toDateTime('2016-12-16 12:00:00'), 1) (toDate('2016-12-16'), toDateTime('2016-12-16 12:00:00'), 1);
SELECT groupUniqArray(d), groupUniqArray(dt) FROM test.grop_uniq_array_date; SELECT groupUniqArray(d), groupUniqArray(dt) FROM test.grop_uniq_array_date;
INSERT INTO test.grop_uniq_array_date VALUES (toDate('2016-12-17'), toDateTime('2016-12-17 12:00:00'), 1), (toDate('2016-12-18'), toDateTime('2016-12-18 12:00:00'), 1), (toDate('2016-12-16'), toDateTime('2016-12-16 12:00:00'), 2);
SELECT length(groupUniqArray(2)(d)), length(groupUniqArray(2)(dt)), length(groupUniqArray(d)), length(groupUniqArray(dt)) FROM test.grop_uniq_array_date GROUP BY id ORDER BY id;
SELECT length(groupUniqArray(10000)(d)), length(groupUniqArray(10000)(dt)) FROM test.grop_uniq_array_date GROUP BY id ORDER BY id;
DROP TABLE IF EXISTS test.grop_uniq_array_date; DROP TABLE IF EXISTS test.grop_uniq_array_date;