mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added simple test.
This commit is contained in:
parent
40bedd88e7
commit
56e4bf6bd7
10
tests/queries/0_stateless/02008_materialize_column.reference
Normal file
10
tests/queries/0_stateless/02008_materialize_column.reference
Normal 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']
|
45
tests/queries/0_stateless/02008_materialize_column.sql
Normal file
45
tests/queries/0_stateless/02008_materialize_column.sql
Normal 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;
|
||||
|
Loading…
Reference in New Issue
Block a user