ClickHouse/dbms/tests/queries/0_stateless/00615_nullable_alter_optimize.sql

23 lines
540 B
MySQL
Raw Normal View History

2018-04-05 20:41:55 +00:00
DROP TABLE IF EXISTS test;
CREATE TABLE test
(
dt Date,
id Int32,
key String,
data Nullable(Int8)
) ENGINE = MergeTree(dt, (id, key, dt), 8192);
2018-04-05 23:00:19 +00:00
INSERT INTO test (dt,id, key,data) VALUES ('2000-01-01', 100, 'key', 100500);
2018-04-05 20:41:55 +00:00
alter table test drop column data;
alter table test add column data Nullable(Float64);
2018-04-05 23:00:19 +00:00
INSERT INTO test (dt,id, key,data) VALUES ('2000-01-01', 100, 'key', 100500);
2018-04-05 20:41:55 +00:00
2018-04-05 20:43:35 +00:00
SELECT * FROM test ORDER BY data NULLS FIRST;
2018-04-05 20:41:55 +00:00
OPTIMIZE TABLE test;
2018-04-05 20:43:35 +00:00
SELECT * FROM test ORDER BY data NULLS FIRST;
2018-04-05 20:41:55 +00:00
DROP TABLE test;