Add test for move partition

This commit is contained in:
Guillaume Tassery 2019-07-26 12:05:19 +02:00
parent 6fdedfc0e5
commit 395e71c7c2
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,4 @@
10000000
0
5000000
5000000

View File

@ -0,0 +1,28 @@
CREATE TABLE IF NOT EXISTS test_move_partition_src (
pk UInt8,
val UInt32
) Engine = MergeTree()
PARTITION BY pk
ORDER BY (pk, val);
CREATE TABLE IF NOT EXISTS test_move_partition_dest (
pk UInt8,
val UInt32
) Engine = MergeTree()
PARTITION BY pk
ORDER BY (pk, val);
TRUNCATE TABLE test_move_partition_src;
TRUNCATE TABLE test_move_partition_dest;
INSERT INTO test_move_partition_src SELECT number % 2, number FROM system.numbers LIMIT 10000000;
SELECT count() FROM test_move_partition_src;
SELECT count() FROM test_move_partition_dest;
ALTER TABLE test_move_partition_src MOVE PARTITION 1 TO test_move_partition_dest;
SELECT count() FROM test_move_partition_src;
SELECT count() FROM test_move_partition_dest;