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

24 lines
646 B
MySQL
Raw Normal View History

2019-06-03 17:36:27 +00:00
DROP TABLE IF EXISTS test_00615;
2018-04-05 20:41:55 +00:00
2022-06-23 08:37:52 +00:00
set allow_deprecated_syntax_for_merge_tree=1;
2019-06-03 17:36:27 +00:00
CREATE TABLE test_00615
2018-04-05 20:41:55 +00:00
(
dt Date,
id Int32,
key String,
data Nullable(Int8)
) ENGINE = MergeTree(dt, (id, key, dt), 8192);
2019-06-03 17:36:27 +00:00
INSERT INTO test_00615 (dt,id, key,data) VALUES ('2000-01-01', 100, 'key', 100500);
2018-04-05 20:41:55 +00:00
2019-06-03 17:36:27 +00:00
alter table test_00615 drop column data;
alter table test_00615 add column data Nullable(Float64);
2018-04-05 20:41:55 +00:00
2019-06-03 17:36:27 +00:00
INSERT INTO test_00615 (dt,id, key,data) VALUES ('2000-01-01', 100, 'key', 100500);
2018-04-05 20:41:55 +00:00
2019-06-03 17:36:27 +00:00
SELECT * FROM test_00615 ORDER BY data NULLS FIRST;
OPTIMIZE TABLE test_00615;
SELECT * FROM test_00615 ORDER BY data NULLS FIRST;
2018-04-05 20:43:35 +00:00
2019-06-03 17:36:27 +00:00
DROP TABLE test_00615;