mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Add a test for dictGet in sharding_key after dictionary reload
This commit is contained in:
parent
8084ce75cb
commit
7e4494e268
@ -0,0 +1,4 @@
|
|||||||
|
1
|
||||||
|
2
|
||||||
|
2
|
||||||
|
1
|
@ -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;
|
Loading…
Reference in New Issue
Block a user