replace word anime with word big

This commit is contained in:
Nikita Mikhailov 2020-12-23 22:02:53 +03:00
parent a35ef5ace3
commit 7ac7d991ad
3 changed files with 18 additions and 18 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<yandex>
<remote_servers>
<anime_source>
<big_source>
<shard>
<internal_replication>true</internal_replication>
<replica>
@ -57,15 +57,15 @@
<port>9000</port>
</replica>
</shard>
</anime_source>
</big_source>
<anime_destination>
<big_destination>
<shard>
<replica>
<host>s1_0_0</host>
<port>9000</port>
</replica>
</shard>
</anime_destination>
</big_destination>
</remote_servers>
</yandex>

View File

@ -1,7 +1,7 @@
<yandex>
<!-- Configuration of clusters as in an ordinary server config -->
<remote_servers>
<anime_source>
<big_source>
<shard>
<internal_replication>true</internal_replication>
<replica>
@ -57,16 +57,16 @@
<port>9000</port>
</replica>
</shard>
</anime_source>
</big_source>
<anime_destination>
<big_destination>
<shard>
<replica>
<host>s1_0_0</host>
<port>9000</port>
</replica>
</shard>
</anime_destination>
</big_destination>
</remote_servers>
<!-- How many simultaneously active workers are possible. If you run more workers superfluous workers will sleep. -->
@ -98,14 +98,14 @@
<!-- A table task, copies one table. -->
<table_first>
<!-- Source cluster name (from <remote_servers/> section) and tables in it that should be copied -->
<cluster_pull>anime_source</cluster_pull>
<cluster_pull>big_source</cluster_pull>
<database_pull>default</database_pull>
<table_pull>anime_all</table_pull>
<table_pull>big_all</table_pull>
<!-- Destination cluster name and tables in which the data should be inserted -->
<cluster_push>anime_destination</cluster_push>
<cluster_push>big_destination</cluster_push>
<database_push>default</database_push>
<table_push>anime</table_push>
<table_push>big</table_push>
<!-- Engine of destination tables.
If destination tables have not be created, workers create them using columns definition from source tables and engine

View File

@ -80,21 +80,21 @@ class Task_many_to_one:
def start(self):
instance = cluster.instances['s0_0_0']
for cluster_num in ["anime_source", "anime_destination"]:
for cluster_num in ["big_source", "big_destination"]:
instance.query("DROP DATABASE IF EXISTS default ON CLUSTER {}".format(cluster_num))
instance.query("CREATE DATABASE IF NOT EXISTS default ON CLUSTER {}".format(cluster_num))
instance.query("CREATE TABLE anime ON CLUSTER anime_source (first_id UUID DEFAULT generateUUIDv4(), second_id UInt64, datetime DateTime DEFAULT now()) " +
instance.query("CREATE TABLE big ON CLUSTER big_source (first_id UUID DEFAULT generateUUIDv4(), second_id UInt64, datetime DateTime DEFAULT now()) " +
"ENGINE=ReplicatedMergeTree " +
"PARTITION BY toSecond(datetime) " +
"ORDER BY (first_id, second_id, toSecond(datetime))")
instance.query("CREATE TABLE anime_all ON CLUSTER anime_source (first_id UUID, second_id UInt64, datetime DateTime) ENGINE=Distributed(anime_source, default, anime, rand() % 5)")
instance.query("INSERT INTO anime_all SELECT generateUUIDv4(), number, now() FROM system.numbers LIMIT 1002",
instance.query("CREATE TABLE big_all ON CLUSTER big_source (first_id UUID, second_id UInt64, datetime DateTime) ENGINE=Distributed(big_source, default, big, rand() % 5)")
instance.query("INSERT INTO big_all SELECT generateUUIDv4(), number, now() FROM system.numbers LIMIT 1002",
settings={"insert_distributed_sync": 1})
def check(self):
assert TSV(self.cluster.instances['s0_0_0'].query("SELECT count() FROM anime_all")) == TSV("1002\n")
assert TSV(self.cluster.instances['s1_0_0'].query("SELECT count() FROM anime")) == TSV("1002\n")
assert TSV(self.cluster.instances['s0_0_0'].query("SELECT count() FROM big_all")) == TSV("1002\n")
assert TSV(self.cluster.instances['s1_0_0'].query("SELECT count() FROM big")) == TSV("1002\n")
def execute_task(task, cmd_options):
task.start()