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;
|