mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
dbms: added test for alter [#METR-10550]
This commit is contained in:
parent
d50aaf9368
commit
00d5cfbe45
10
dbms/tests/queries/0_stateless/00030_1_alter_table.reference
Normal file
10
dbms/tests/queries/0_stateless/00030_1_alter_table.reference
Normal file
@ -0,0 +1,10 @@
|
||||
CounterID UInt32
|
||||
StartDate Date
|
||||
UserID UInt32
|
||||
VisitID UInt32
|
||||
NestedColumn.A Array(UInt8)
|
||||
NestedColumn.S Array(String)
|
||||
ToDrop UInt32
|
||||
Added0 UInt32
|
||||
Added1 UInt32
|
||||
Added2 UInt32
|
11
dbms/tests/queries/0_stateless/00030_1_alter_table.sql
Normal file
11
dbms/tests/queries/0_stateless/00030_1_alter_table.sql
Normal file
@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS alter_test;
|
||||
|
||||
CREATE TABLE alter_test (CounterID UInt32, StartDate Date, UserID UInt32, VisitID UInt32, NestedColumn Nested(A UInt8, S String), ToDrop UInt32) ENGINE = MergeTree(StartDate, intHash32(UserID), (CounterID, StartDate, intHash32(UserID), VisitID), 8192);
|
||||
|
||||
INSERT INTO alter_test VALUES (1, '2014-01-01', 2, 3, [1,2,3], ['a','b','c'], 4);
|
||||
|
||||
ALTER TABLE alter_test ADD COLUMN Added0 UInt32;
|
||||
ALTER TABLE alter_test ADD COLUMN Added2 UInt32;
|
||||
ALTER TABLE alter_test ADD COLUMN Added1 UInt32 AFTER Added0;
|
||||
|
||||
DESC TABLE alter_test;
|
@ -0,0 +1,7 @@
|
||||
CounterID UInt32
|
||||
StartDate Date
|
||||
UserID UInt32
|
||||
VisitID UInt32
|
||||
Added0 String
|
||||
Added1 UInt32
|
||||
Added2 UInt32
|
8
dbms/tests/queries/0_stateless/00030_2_alter_table.sql
Normal file
8
dbms/tests/queries/0_stateless/00030_2_alter_table.sql
Normal file
@ -0,0 +1,8 @@
|
||||
ALTER TABLE alter_test DROP COLUMN ToDrop;
|
||||
|
||||
ALTER TABLE alter_test MODIFY COLUMN Added0 String;
|
||||
|
||||
ALTER TABLE alter_test DROP COLUMN `NestedColumn.A`;
|
||||
ALTER TABLE alter_test DROP COLUMN `NestedColumn.S`;
|
||||
|
||||
DESC TABLE alter_test;
|
@ -0,0 +1 @@
|
||||
1 2014-01-01 2 3 0 0
|
3
dbms/tests/queries/0_stateless/00030_3_alter_table.sql
Normal file
3
dbms/tests/queries/0_stateless/00030_3_alter_table.sql
Normal file
@ -0,0 +1,3 @@
|
||||
SELECT * FROM alter_test;
|
||||
|
||||
DROP TABLE alter_test;
|
Loading…
Reference in New Issue
Block a user