· 7 years ago · Nov 08, 2018, 08:40 AM
1root@f-clickhouse-n1:~# clickhouse-client
2ClickHouse client version 1.1.54343.
3Connecting to localhost:9000.
4Connected to ClickHouse server version 1.1.54343.
5
6:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser.channel ON CLUSTER fornex_cluster (
7:-] channel_id String,
8:-] name String,
9:-] description String,
10:-] image String,
11:-] country String,
12:-] subscribers UInt64,
13:-] views UInt64,
14:-] videos UInt64,
15:-] created_at_date Date,
16:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, channel, rand());
17
18CREATE TABLE IF NOT EXISTS fazze_youtube_parser.channel ON CLUSTER fornex_cluster
19(
20 channel_id String,
21 name String,
22 description String,
23 image String,
24 country String,
25 subscribers UInt64,
26 views UInt64,
27 videos UInt64,
28 created_at_date Date,
29 created_at_time DateTime
30)
31ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, channel, rand())
32
33┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
34│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
35│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
36│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
37│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
38│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
39│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
40└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
41
426 rows in set. Elapsed: 0.110 sec.
43
44:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser.video ON CLUSTER fornex_cluster (
45:-] video_id String,
46:-] channel_id String,
47:-] name String,
48:-] description String,
49:-] category String,
50:-] likes UInt64,
51:-] dislikes UInt64,
52:-] views UInt64,
53:-] publication_date Date,
54:-] created_at_date Date,
55:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, video, rand());
56
57CREATE TABLE IF NOT EXISTS fazze_youtube_parser.video ON CLUSTER fornex_cluster
58(
59 video_id String,
60 channel_id String,
61 name String,
62 description String,
63 category String,
64 likes UInt64,
65 dislikes UInt64,
66 views UInt64,
67 publication_date Date,
68 created_at_date Date,
69 created_at_time DateTime
70)
71ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, video, rand())
72
73┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
74│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
75│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
76│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
77│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
78│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
79│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
80└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
81
826 rows in set. Elapsed: 0.107 sec.
83
84:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser.url ON CLUSTER fornex_cluster (
85:-] channel_id String,
86:-] video_id String,
87:-] short_url String,
88:-] final_url String,
89:-] created_at_date Date,
90:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url, rand());
91
92CREATE TABLE IF NOT EXISTS fazze_youtube_parser.url ON CLUSTER fornex_cluster
93(
94 channel_id String,
95 video_id String,
96 short_url String,
97 final_url String,
98 created_at_date Date,
99 created_at_time DateTime
100)
101ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url, rand())
102
103┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
104│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
105│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
106│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
107│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
108│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
109│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
110└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
111
1126 rows in set. Elapsed: 0.106 sec.
113
114:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser.url_dirty ON CLUSTER fornex_cluster (
115:-] durl_url String,
116:-] video_id String,
117:-] created_at_date Date,
118:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url_dirty, rand());
119
120CREATE TABLE IF NOT EXISTS fazze_youtube_parser.url_dirty ON CLUSTER fornex_cluster
121(
122 durl_url String,
123 video_id String,
124 created_at_date Date,
125 created_at_time DateTime
126)
127ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url_dirty, rand())
128
129┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
130│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
131│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
132│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
133│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
134│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
135│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
136└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
137
1386 rows in set. Elapsed: 0.108 sec.
139
140:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser_shard.channel ON CLUSTER fornex_cluster AS fazze_youtube_parser.channel ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/channel', '{replica}', created_at_date, (channel_id, name), 8192);
141
142CREATE TABLE IF NOT EXISTS fazze_youtube_parser_shard.channel ON CLUSTER fornex_cluster AS fazze_youtube_parser.channel
143ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/channel', '{replica}', created_at_date, (channel_id, name), 8192)
144
145┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
146│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
147│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
148│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
149│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
150│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
151│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
152└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
153
1546 rows in set. Elapsed: 0.109 sec.
155
156:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser_shard.video ON CLUSTER fornex_cluster AS fazze_youtube_parser.video ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/video', '{replica}', created_at_date, (video_id, name), 8192);
157
158CREATE TABLE IF NOT EXISTS fazze_youtube_parser_shard.video ON CLUSTER fornex_cluster AS fazze_youtube_parser.video
159ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/video', '{replica}', created_at_date, (video_id, name), 8192)
160
161┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
162│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
163│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
164│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
165│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
166│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
167│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
168└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
169
1706 rows in set. Elapsed: 0.107 sec.
171
172:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser_shard.url ON CLUSTER fornex_cluster AS fazze_youtube_parser.url ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/url', '{replica}', created_at_date, (short_url, video_id), 8192);
173
174CREATE TABLE IF NOT EXISTS fazze_youtube_parser_shard.url ON CLUSTER fornex_cluster AS fazze_youtube_parser.url
175ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/url', '{replica}', created_at_date, (short_url, video_id), 8192)
176
177┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
178│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
179│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
180│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
181│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
182│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
183│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
184└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
185
1866 rows in set. Elapsed: 0.109 sec.
187
188:) CREATE TABLE fazze_youtube_parser_shard.url_dirty ON CLUSTER fornex_cluster AS fazze_youtube_parser.url_dirty ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/url_dirty', '{replica}', created_at_date, (durl_url, video_id), 8192);
189
190CREATE TABLE fazze_youtube_parser_shard.url_dirty ON CLUSTER fornex_cluster AS fazze_youtube_parser.url_dirty
191ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/url_dirty', '{replica}', created_at_date, (durl_url, video_id), 8192)
192
193┌─host──────────────────┬─port─┬─status─┬─error───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─num_hosts_remaining─┬─num_hosts_active─â”
194│ f-clickhouse-n5.local │ 9000 │ 57 │ Code: 57, e.displayText() = DB::Exception: Table fazze_youtube_parser_shard.url_dirty already exists., e.what() = DB::Exception │ 5 │ 1 │
195│ f-clickhouse-n2.local │ 9000 │ 57 │ Code: 57, e.displayText() = DB::Exception: Table fazze_youtube_parser_shard.url_dirty already exists., e.what() = DB::Exception │ 4 │ 1 │
196│ f-clickhouse-n3.local │ 9000 │ 57 │ Code: 57, e.displayText() = DB::Exception: Table fazze_youtube_parser_shard.url_dirty already exists., e.what() = DB::Exception │ 3 │ 1 │
197│ f-clickhouse-n4.local │ 9000 │ 57 │ Code: 57, e.displayText() = DB::Exception: Table fazze_youtube_parser_shard.url_dirty already exists., e.what() = DB::Exception │ 2 │ 1 │
198│ f-clickhouse-n1.local │ 9000 │ 57 │ Code: 57, e.displayText() = DB::Exception: Table fazze_youtube_parser_shard.url_dirty already exists., e.what() = DB::Exception │ 1 │ 1 │
199└───────────────────────┴──────┴────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────────────┴──────────────────┘
200┌─host──────────────────┬─port─┬─status─┬─error───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─num_hosts_remaining─┬─num_hosts_active─â”
201│ f-clickhouse-n6.local │ 9000 │ 57 │ Code: 57, e.displayText() = DB::Exception: Table fazze_youtube_parser_shard.url_dirty already exists., e.what() = DB::Exception │ 0 │ 0 │
202└───────────────────────┴──────┴────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────────────┴──────────────────┘
203
2046 rows in set. Elapsed: 0.158 sec.
205
206:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.channel ON CLUSTER fornex_cluster AS fazze_youtube_parser.channel ENGINE = Buffer(fazze_youtube_parser_shard, channel, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
207
208CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.channel ON CLUSTER fornex_cluster AS fazze_youtube_parser.channel
209ENGINE = Buffer(fazze_youtube_parser_shard, channel, 16, 10, 100, 10000, 1000000, 10000000, 100000000)
210
211┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
212│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
213│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
214│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
215│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
216│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
217│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
218└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
219
2206 rows in set. Elapsed: 0.108 sec.
221
222:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.video ON CLUSTER fornex_cluster AS fazze_youtube_parser.video ENGINE = Buffer(fazze_youtube_parser_shard, video, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
223
224CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.video ON CLUSTER fornex_cluster AS fazze_youtube_parser.video
225ENGINE = Buffer(fazze_youtube_parser_shard, video, 16, 10, 100, 10000, 1000000, 10000000, 100000000)
226
227┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
228│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
229│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
230│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
231│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
232│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 1 │ 0 │
233└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
234┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
235│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 0 │ 0 │
236└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
237
2386 rows in set. Elapsed: 0.108 sec.
239
240:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.url ON CLUSTER fornex_cluster AS fazze_youtube_parser.url ENGINE = Buffer(fazze_youtube_parser_shard, url, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
241
242CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.url ON CLUSTER fornex_cluster AS fazze_youtube_parser.url
243ENGINE = Buffer(fazze_youtube_parser_shard, url, 16, 10, 100, 10000, 1000000, 10000000, 100000000)
244
245┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
246│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
247│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
248│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
249│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
250│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
251│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
252└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
253
2546 rows in set. Elapsed: 0.107 sec.
255
256:) CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.url_dirty ON CLUSTER fornex_cluster AS fazze_youtube_parser.url_dirty ENGINE = Buffer(fazze_youtube_parser_shard, url_dirty, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
257
258CREATE TABLE IF NOT EXISTS fazze_youtube_parser_buffer.url_dirty ON CLUSTER fornex_cluster AS fazze_youtube_parser.url_dirty
259ENGINE = Buffer(fazze_youtube_parser_shard, url_dirty, 16, 10, 100, 10000, 1000000, 10000000, 100000000)
260
261┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
262│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
263│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
264│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
265│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
266│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
267│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
268└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
269
2706 rows in set. Elapsed: 0.117 sec.
271
272:)