dbms: added tests [#METR-13168].

This commit is contained in:
Alexey Milovidov 2015-10-04 09:25:33 +03:00
parent 804216f678
commit 49852e67fb
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,57 @@
[] [1] 1
[1] [] 1
[] [0,1,2,3,4,5,6,7,8,9] 1
[0] [0,1,2,3,4,5,6,7,8] 1
[0,1] [0,1,2,3,4,5,6,7] 1
[0,1,2] [0,1,2,3,4,5,6] 1
[0,1,2,3] [0,1,2,3,4,5] 1
[0,1,2,3,4] [0,1,2,3,4] 1
[0,1,2,3,4,5] [0,1,2,3] 1
[0,1,2,3,4,5,6] [0,1,2] 1
[0,1,2,3,4,5,6,7] [0,1] 1
[0,1,2,3,4,5,6,7,8] [0] 1
[0,1,2,3,4,5,6,7,8,9] [] 1
[] [0,1,2,3,4,5,6,7,8,9] 1
['0'] [0,1,2,3,4,5,6,7,8] 1
['0','1'] [0,1,2,3,4,5,6,7] 1
['0','1','2'] [0,1,2,3,4,5,6] 1
['0','1','2','3'] [0,1,2,3,4,5] 1
['0','1','2','3','4'] [0,1,2,3,4] 1
['0','1','2','3','4','5'] [0,1,2,3] 1
['0','1','2','3','4','5','6'] [0,1,2] 1
['0','1','2','3','4','5','6','7'] [0,1] 1
['0','1','2','3','4','5','6','7','8'] [0] 1
['0','1','2','3','4','5','6','7','8','9'] [] 1
[] ['0','1','2','3','4','5','6','7','8','9'] 1
['0'] ['0','1','2','3','4','5','6','7','8'] 1
['0','1'] ['0','1','2','3','4','5','6','7'] 1
['0','1','2'] ['0','1','2','3','4','5','6'] 1
['0','1','2','3'] ['0','1','2','3','4','5'] 1
['0','1','2','3','4'] ['0','1','2','3','4'] 1
['0','1','2','3','4','5'] ['0','1','2','3'] 1
['0','1','2','3','4','5','6'] ['0','1','2'] 1
['0','1','2','3','4','5','6','7'] ['0','1'] 1
['0','1','2','3','4','5','6','7','8'] ['0'] 1
['0','1','2','3','4','5','6','7','8','9'] [] 1
[] [] 1
['0'] [[0,1,2,3,4,5,6,7,8]] 1
['0','1'] [[0,1,2,3,4,5,6,7],[0,1,2,3,4,5,6,7]] 1
['0','1','2'] [[0,1,2,3,4,5,6],[0,1,2,3,4,5,6],[0,1,2,3,4,5,6]] 1
['0','1','2','3'] [[0,1,2,3,4,5],[0,1,2,3,4,5],[0,1,2,3,4,5],[0,1,2,3,4,5]] 1
['0','1','2','3','4'] [[0,1,2,3,4],[0,1,2,3,4],[0,1,2,3,4],[0,1,2,3,4],[0,1,2,3,4]] 1
['0','1','2','3','4','5'] [[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3]] 1
['0','1','2','3','4','5','6'] [[0,1,2],[0,1,2],[0,1,2],[0,1,2],[0,1,2],[0,1,2],[0,1,2]] 1
['0','1','2','3','4','5','6','7'] [[0,1],[0,1],[0,1],[0,1],[0,1],[0,1],[0,1],[0,1]] 1
['0','1','2','3','4','5','6','7','8'] [[0],[0],[0],[0],[0],[0],[0],[0],[0]] 1
['0','1','2','3','4','5','6','7','8','9'] [[],[],[],[],[],[],[],[],[],[]] 1
[] [] 3
['0'] [[0,1,2,3,4,5,6,7,8]] 3
['0','1'] [[0,1,2,3,4,5,6,7],[0,1,2,3,4,5,6,7]] 3
['0','1','2'] [[0,1,2,3,4,5,6],[0,1,2,3,4,5,6],[0,1,2,3,4,5,6]] 3
['0','1','2','3'] [[0,1,2,3,4,5],[0,1,2,3,4,5],[0,1,2,3,4,5],[0,1,2,3,4,5]] 3
['0','1','2','3','4'] [[0,1,2,3,4],[0,1,2,3,4],[0,1,2,3,4],[0,1,2,3,4],[0,1,2,3,4]] 3
['0','1','2','3','4','5'] [[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3],[0,1,2,3]] 3
['0','1','2','3','4','5','6'] [[0,1,2],[0,1,2],[0,1,2],[0,1,2],[0,1,2],[0,1,2],[0,1,2]] 3
['0','1','2','3','4','5','6','7'] [[0,1],[0,1],[0,1],[0,1],[0,1],[0,1],[0,1],[0,1]] 2
['0','1','2','3','4','5','6','7','8'] [[0],[0],[0],[0],[0],[0],[0],[0],[0]] 2
['0','1','2','3','4','5','6','7','8','9'] [[],[],[],[],[],[],[],[],[],[]] 2

View File

@ -0,0 +1,6 @@
SELECT arr1, arr2, count() AS c FROM (SELECT emptyArrayUInt8() AS arr1, [1] AS arr2 UNION ALL SELECT [1], emptyArrayUInt8()) GROUP BY arr1, arr2 ORDER BY c DESC, arr1, arr2;
SELECT arr1, arr2, count() AS c FROM (SELECT range(number) AS arr1, range(toUInt64(10 - number)) AS arr2 FROM system.numbers LIMIT 11) GROUP BY arr1, arr2 ORDER BY c DESC, arr1, arr2;
SELECT arr1, arr2, count() AS c FROM (SELECT arrayMap(x -> toString(x), range(number)) AS arr1, range(toUInt64(10 - number)) AS arr2 FROM system.numbers LIMIT 11) GROUP BY arr1, arr2 ORDER BY c DESC, arr1, arr2;
SELECT arr1, arr2, count() AS c FROM (SELECT arrayMap(x -> toString(x), range(number)) AS arr1, arrayMap(x -> toString(x), range(toUInt64(10 - number))) AS arr2 FROM system.numbers LIMIT 11) GROUP BY arr1, arr2 ORDER BY c DESC, arr1, arr2;
SELECT arr1, arr2, count() AS c FROM (SELECT arrayMap(x -> toString(x), range(number)) AS arr1, replicate(range(toUInt64(10 - number)), arr1) AS arr2 FROM system.numbers LIMIT 11) GROUP BY arr1, arr2 ORDER BY c DESC, arr1, arr2;
SELECT arr1, arr2, count() AS c FROM (SELECT arrayMap(x -> toString(x), range(number)) AS arr1, replicate(range(toUInt64(10 - number)), arr1) AS arr2 FROM (SELECT number % 11 AS number FROM system.numbers LIMIT 30)) GROUP BY arr1, arr2 ORDER BY c DESC, arr1, arr2;