mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #17410 from ClickHouse/test_mutation_for_empty_partitions
Add test for mutation with empty partition
This commit is contained in:
commit
90bddce5ed
@ -0,0 +1,5 @@
|
||||
10
|
||||
10
|
||||
10
|
||||
24
|
||||
CREATE TABLE default.replicated_mutations_empty_partitions\n(\n `key` UInt64,\n `value` UInt64\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/test/01586_replicated_mutations_empty_partitions\', \'1\')\nPARTITION BY key\nORDER BY key\nSETTINGS index_granularity = 8192
|
@ -0,0 +1,32 @@
|
||||
DROP TABLE IF EXISTS replicated_mutations_empty_partitions;
|
||||
|
||||
CREATE TABLE replicated_mutations_empty_partitions
|
||||
(
|
||||
key UInt64,
|
||||
value String
|
||||
)
|
||||
ENGINE = ReplicatedMergeTree('/clickhouse/test/01586_replicated_mutations_empty_partitions', '1')
|
||||
ORDER BY key
|
||||
PARTITION by key;
|
||||
|
||||
INSERT INTO replicated_mutations_empty_partitions SELECT number, toString(number) FROM numbers(10);
|
||||
|
||||
SELECT count(distinct value) FROM replicated_mutations_empty_partitions;
|
||||
|
||||
SELECT count() FROM system.zookeeper WHERE path = '/clickhouse/test/01586_replicated_mutations_empty_partitions/block_numbers';
|
||||
|
||||
ALTER TABLE replicated_mutations_empty_partitions DROP PARTITION '3';
|
||||
ALTER TABLE replicated_mutations_empty_partitions DROP PARTITION '4';
|
||||
ALTER TABLE replicated_mutations_empty_partitions DROP PARTITION '5';
|
||||
ALTER TABLE replicated_mutations_empty_partitions DROP PARTITION '9';
|
||||
|
||||
-- still ten records
|
||||
SELECT count() FROM system.zookeeper WHERE path = '/clickhouse/test/01586_replicated_mutations_empty_partitions/block_numbers';
|
||||
|
||||
ALTER TABLE replicated_mutations_empty_partitions MODIFY COLUMN value UInt64 SETTINGS replication_alter_partitions_sync=2;
|
||||
|
||||
SELECT sum(value) FROM replicated_mutations_empty_partitions;
|
||||
|
||||
SHOW CREATE TABLE replicated_mutations_empty_partitions;
|
||||
|
||||
DROP TABLE IF EXISTS replicated_mutations_empty_partitions;
|
Loading…
Reference in New Issue
Block a user