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

24 lines
536 B
MySQL
Raw Normal View History

2018-04-05 20:41:55 +00:00
USE test;
DROP TABLE IF EXISTS test;
CREATE TABLE test
(
dt Date,
id Int32,
key String,
data Nullable(Int8)
) ENGINE = MergeTree(dt, (id, key, dt), 8192);
INSERT INTO test (dt,id, key,data) VALUES (now(), 100, 'key', 100500);
alter table test drop column data;
alter table test add column data Nullable(Float64);
INSERT INTO test (dt,id, key,data) VALUES (now(), 100, 'key', 100500);
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;