· 7 years ago · Nov 08, 2018, 05:22 AM
1:) CREATE DATABASE IF NOT EXISTS fazze_youtube_parser ON CLUSTER fornex_cluster;
2
3CREATE DATABASE IF NOT EXISTS fazze_youtube_parser ON CLUSTER fornex_cluster
4
5┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
6│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
7│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
8│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
9│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
10│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
11│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
12└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
13
146 rows in set. Elapsed: 0.133 sec.
15
16:) CREATE DATABASE IF NOT EXISTS fazze_youtube_parser_buffer ON CLUSTER fornex_cluster;
17
18CREATE DATABASE IF NOT EXISTS fazze_youtube_parser_buffer ON CLUSTER fornex_cluster
19
20┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
21│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
22│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
23│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
24│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
25│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
26│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
27└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
28
296 rows in set. Elapsed: 0.115 sec.
30
31:) CREATE DATABASE IF NOT EXISTS fazze_youtube_parser_shard ON CLUSTER fornex_cluster;
32
33CREATE DATABASE IF NOT EXISTS fazze_youtube_parser_shard ON CLUSTER fornex_cluster
34
35┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
36│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
37│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
38│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
39│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
40│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
41│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
42└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
43
446 rows in set. Elapsed: 0.107 sec.
45
46:) CREATE TABLE fazze_youtube_parser.channel ON CLUSTER fornex_cluster (
47:-] channel_id String,
48:-] name String,
49:-] description String,
50:-] image String,
51:-] country String,
52:-] subscribers UInt64,
53:-] views UInt64,
54:-] videos UInt64,
55:-] created_at_date Date,
56:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, channel, rand());
57
58CREATE TABLE fazze_youtube_parser.channel ON CLUSTER fornex_cluster
59(
60 channel_id String,
61 name String,
62 description String,
63 image String,
64 country String,
65 subscribers UInt64,
66 views UInt64,
67 videos UInt64,
68 created_at_date Date,
69 created_at_time DateTime
70)
71ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, channel, 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-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
78│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
79│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
80└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
81
826 rows in set. Elapsed: 0.108 sec.
83
84:) CREATE TABLE fazze_youtube_parser.video ON CLUSTER fornex_cluster (
85:-] video_id String,
86:-] channel_id String,
87:-] name String,
88:-] description String,
89:-] category String,
90:-] likes UInt64,
91:-] dislikes UInt64,
92:-] views UInt64,
93:-] publication_date Date,
94:-] created_at_date Date,
95:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, video, rand());
96
97CREATE TABLE fazze_youtube_parser.video ON CLUSTER fornex_cluster
98(
99 video_id String,
100 channel_id String,
101 name String,
102 description String,
103 category String,
104 likes UInt64,
105 dislikes UInt64,
106 views UInt64,
107 publication_date Date,
108 created_at_date Date,
109 created_at_time DateTime
110)
111ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, video, rand())
112
113┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
114│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
115│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
116│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
117│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
118│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
119│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
120└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
121
1226 rows in set. Elapsed: 0.108 sec.
123
124:) CREATE TABLE fazze_youtube_parser.url ON CLUSTER fornex_cluster (
125:-] channel_id String,
126:-] video_id String,
127:-] short_url String,
128:-] final_url String,
129:-] created_at_date Date,
130:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url, rand());
131
132CREATE TABLE fazze_youtube_parser.url ON CLUSTER fornex_cluster
133(
134 channel_id String,
135 video_id String,
136 short_url String,
137 final_url String,
138 created_at_date Date,
139 created_at_time DateTime
140)
141ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url, rand())
142
143┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
144│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
145│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
146│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
147│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 2 │ 0 │
148│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 1 │ 0 │
149│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
150└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
151
1526 rows in set. Elapsed: 0.108 sec.
153
154:) CREATE TABLE fazze_youtube_parser.url_dirty ON CLUSTER fornex_cluster (
155:-] durl_url String,
156:-] video_id String,
157:-] created_at_date Date,
158:-] created_at_time DateTime) ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url_dirty, rand());
159
160CREATE TABLE fazze_youtube_parser.url_dirty ON CLUSTER fornex_cluster
161(
162 durl_url String,
163 video_id String,
164 created_at_date Date,
165 created_at_time DateTime
166)
167ENGINE = Distributed(fornex_cluster, fazze_youtube_parser_buffer, url_dirty, rand())
168
169┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
170│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
171│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
172│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
173│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
174│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
175│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
176└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
177
1786 rows in set. Elapsed: 0.109 sec.
179
180:) CREATE TABLE 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);
181
182Syntax error: failed at position 107:
183
184CREATE TABLE 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);
185
186Unmatched parentheses: (
187
188:) CREATE TABLE 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);
189
190Syntax error: failed at position 107:
191
192CREATE TABLE 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);
193
194Unmatched parentheses: (
195
196:) CREATE TABLE 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);
197
198CREATE TABLE fazze_youtube_parser_shard.channel ON CLUSTER fornex_cluster AS fazze_youtube_parser.channel
199ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/channel', '{replica}', created_at_date, (channel_id, name), 8192)
200
201┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
202│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 2 │
203│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 4 │ 2 │
204│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 3 │ 2 │
205│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 2 │ 2 │
206└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
207┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
208│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 1 │ 0 │
209│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 0 │ 0 │
210└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
211
2126 rows in set. Elapsed: 0.279 sec.
213
214:) CREATE TABLE 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);
215
216CREATE TABLE fazze_youtube_parser_shard.video ON CLUSTER fornex_cluster AS fazze_youtube_parser.video
217ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/video', '{replica}', created_at_date, (video_id, name), 8192)
218
219┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
220│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
221│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
222│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
223│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
224│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
225│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
226└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
227
2286 rows in set. Elapsed: 0.107 sec.
229
230:) CREATE TABLE 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);
231
232CREATE TABLE fazze_youtube_parser_shard.url ON CLUSTER fornex_cluster AS fazze_youtube_parser.url
233ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/url', '{replica}', created_at_date, (short_url, video_id), 8192)
234
235┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
236│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
237│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
238│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
239│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
240│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
241│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
242└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
243
2446 rows in set. Elapsed: 0.111 sec.
245
246:) 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);
247
248CREATE TABLE fazze_youtube_parser_shard.url_dirty ON CLUSTER fornex_cluster AS fazze_youtube_parser.url_dirty
249ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/fazze_youtube_parser_shard/url_dirty', '{replica}', created_at_date, (durl_url, video_id), 8192)
250
251┌─host──────────────────┬─port─┬─status─┬─error─┬─num_hosts_remaining─┬─num_hosts_active─â”
252│ f-clickhouse-n5.local │ 9000 │ 0 │ │ 5 │ 0 │
253│ f-clickhouse-n2.local │ 9000 │ 0 │ │ 4 │ 0 │
254│ f-clickhouse-n3.local │ 9000 │ 0 │ │ 3 │ 0 │
255│ f-clickhouse-n4.local │ 9000 │ 0 │ │ 2 │ 0 │
256│ f-clickhouse-n1.local │ 9000 │ 0 │ │ 1 │ 0 │
257│ f-clickhouse-n6.local │ 9000 │ 0 │ │ 0 │ 0 │
258└───────────────────────┴──────┴────────┴───────┴─────────────────────┴──────────────────┘
259
2606 rows in set. Elapsed: 0.107 sec.
261
262:)