Added simple test.

This commit is contained in:
Vladimir Chebotarev 2021-08-12 10:38:36 +03:00
parent 40bedd88e7
commit 56e4bf6bd7
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ['3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22']

View File

@ -0,0 +1,45 @@
DROP TABLE IF EXISTS tmp;
SET mutations_sync = 2;
CREATE TABLE tmp (x Int64) ENGINE = MergeTree() ORDER BY tuple() PARTITION BY tuple();
INSERT INTO tmp SELECT * FROM system.numbers LIMIT 20;
ALTER TABLE tmp ADD COLUMN s String DEFAULT toString(x);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MODIFY COLUMN s String DEFAULT toString(x+1);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MATERIALIZE COLUMN s;
ALTER TABLE tmp MODIFY COLUMN s String DEFAULT toString(x+2);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MATERIALIZE COLUMN s;
ALTER TABLE tmp MODIFY COLUMN s String DEFAULT toString(x+3);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MATERIALIZE COLUMN s FINAL;
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp DROP COLUMN s;
ALTER TABLE tmp ADD COLUMN s String MATERIALIZED toString(x);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MODIFY COLUMN s String MATERIALIZED toString(x+1);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MATERIALIZE COLUMN s;
ALTER TABLE tmp MODIFY COLUMN s String MATERIALIZED toString(x+2);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MATERIALIZE COLUMN s;
ALTER TABLE tmp MODIFY COLUMN s String MATERIALIZED toString(x+3);
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp MATERIALIZE COLUMN s FINAL;
SELECT groupArray(x), groupArray(s) FROM tmp;
ALTER TABLE tmp DROP COLUMN s;
DROP TABLE tmp;