Add a test for dictGet in sharding_key after dictionary reload

This commit is contained in:
Azat Khuzhin 2020-10-17 01:17:38 +03:00
parent 8084ce75cb
commit 7e4494e268
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,4 @@
1
2
2
1

View File

@ -0,0 +1,26 @@
set allow_nondeterministic_optimize_skip_unused_shards=1;
set optimize_skip_unused_shards=1;
set force_optimize_skip_unused_shards=2;
drop database if exists db_01527_ranges;
drop table if exists dist_01527;
drop table if exists data_01527;
create database db_01527_ranges;
create table data_01527 engine=Memory() as select toUInt64(number) key from numbers(2);
create table dist_01527 as data_01527 engine=Distributed('test_cluster_two_shards', currentDatabase(), data_01527, dictGetUInt64('db_01527_ranges.dict', 'shard', key));
create table db_01527_ranges.data engine=Memory() as select number key, number shard from numbers(100);
create dictionary db_01527_ranges.dict (key UInt64, shard UInt64) primary key key source(clickhouse(host '127.0.0.1' port 9000 table 'data' db 'db_01527_ranges' user 'default' password '')) lifetime(0) layout(hashed());
system reload dictionary db_01527_ranges.dict;
select _shard_num from dist_01527 where key=0;
select _shard_num from dist_01527 where key=1;
drop table db_01527_ranges.data sync;
create table db_01527_ranges.data engine=Memory() as select number key, number+1 shard from numbers(100);
system reload dictionary db_01527_ranges.dict;
select _shard_num from dist_01527 where key=0;
select _shard_num from dist_01527 where key=1;