mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Simple test
This commit is contained in:
parent
92648955c4
commit
fb7c65c9aa
@ -0,0 +1,7 @@
|
||||
14850
|
||||
14850
|
||||
59700
|
||||
59700
|
||||
59700
|
||||
0
|
||||
0
|
51
dbms/tests/queries/0_stateless/01062_alter_on_mutataion.sql
Normal file
51
dbms/tests/queries/0_stateless/01062_alter_on_mutataion.sql
Normal file
@ -0,0 +1,51 @@
|
||||
DROP TABLE IF EXISTS test_alter_on_mutation;
|
||||
|
||||
CREATE TABLE test_alter_on_mutation
|
||||
(
|
||||
date Date,
|
||||
key UInt64,
|
||||
value String
|
||||
)
|
||||
ENGINE ReplicatedMergeTree('/clickhouse/tables/test_alter_on_mutation', '1')
|
||||
ORDER BY key PARTITION BY date;
|
||||
|
||||
INSERT INTO test_alter_on_mutation select toDate('2020-01-05'), number, toString(number) from system.numbers limit 100;
|
||||
INSERT INTO test_alter_on_mutation select toDate('2020-01-06'), number, toString(number) from system.numbers limit 100;
|
||||
INSERT INTO test_alter_on_mutation select toDate('2020-01-07'), number, toString(number) from system.numbers limit 100;
|
||||
|
||||
SELECT sum(cast(value as UInt64)) from test_alter_on_mutation;
|
||||
|
||||
ALTER TABLE test_alter_on_mutation MODIFY COLUMN value UInt64;
|
||||
|
||||
SELECT sum(value) from test_alter_on_mutation;
|
||||
|
||||
INSERT INTO test_alter_on_mutation select toDate('2020-01-05'), number, toString(number) from system.numbers limit 100, 100;
|
||||
INSERT INTO test_alter_on_mutation select toDate('2020-01-06'), number, toString(number) from system.numbers limit 100, 100;
|
||||
INSERT INTO test_alter_on_mutation select toDate('2020-01-07'), number, toString(number) from system.numbers limit 100, 100;
|
||||
|
||||
OPTIMIZE TABLE test_alter_on_mutation FINAL;
|
||||
|
||||
SELECT sum(value) from test_alter_on_mutation;
|
||||
|
||||
ALTER TABLE test_alter_on_mutation MODIFY COLUMN value String;
|
||||
|
||||
SELECT sum(cast(value as UInt64)) from test_alter_on_mutation;
|
||||
|
||||
OPTIMIZE TABLE test_alter_on_mutation FINAL;
|
||||
|
||||
SELECT sum(cast(value as UInt64)) from test_alter_on_mutation;
|
||||
|
||||
ALTER TABLE test_alter_on_mutation ADD COLUMN value1 Float64;
|
||||
|
||||
SELECT sum(value1) from test_alter_on_mutation;
|
||||
|
||||
ALTER TABLE test_alter_on_mutation DROP COLUMN value;
|
||||
|
||||
SELECT sum(value) from test_alter_on_mutation; -- {serverError 47}
|
||||
|
||||
-- this is bug
|
||||
ALTER TABLE test_alter_on_mutation ADD COLUMN value String DEFAULT '0';
|
||||
|
||||
SELECT sum(cast(value as UInt64)) from test_alter_on_mutation;
|
||||
|
||||
--DROP TABLE IF EXISTS test_alter_on_mutation;
|
Loading…
Reference in New Issue
Block a user