Added test.

This commit is contained in:
Nikolai Kochetov 2021-03-17 20:08:49 +03:00
parent 2c1539f641
commit 6397099d3c
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,6 @@
1 2
1 2
[1] 2
[[1]] 2
String1_0 String2_0 String3_0 String4_0 1
String1_0 String2_0 String3_0 String4_0 1

View File

@ -0,0 +1,37 @@
SELECT * FROM (SELECT col1, col2 FROM (select '1' as col1, '2' as col2) GROUP by col1, col2) AS expr_qry WHERE col2 != '';
SELECT * FROM (SELECT materialize('1') AS s1, materialize('2') AS s2 GROUP BY s1, s2) WHERE s2 = '2';
SELECT * FROM (SELECT materialize([1]) AS s1, materialize('2') AS s2 GROUP BY s1, s2) WHERE s2 = '2';
SELECT * FROM (SELECT materialize([[1]]) AS s1, materialize('2') AS s2 GROUP BY s1, s2) WHERE s2 = '2';
DROP TABLE IF EXISTS Test;
CREATE TABLE Test
ENGINE = MergeTree()
PRIMARY KEY (String1,String2)
ORDER BY (String1,String2)
AS
SELECT
'String1_' || toString(number) as String1,
'String2_' || toString(number) as String2,
'String3_' || toString(number) as String3,
'String4_' || toString(number%4) as String4
FROM numbers(1);
SELECT *
FROM
(
SELECT String1,String2,String3,String4,COUNT(*)
FROM Test
GROUP by String1,String2,String3,String4
) AS expr_qry;
SELECT *
FROM
(
SELECT String1,String2,String3,String4,COUNT(*)
FROM Test
GROUP by String1,String2,String3,String4
) AS expr_qry
WHERE String4 ='String4_0';
DROP TABLE IF EXISTS Test;