Skip to content

Commit 4d3cf6a

Browse files
authored
Merge branch 'main' into sphoorti
2 parents 886198c + ddcced2 commit 4d3cf6a

File tree

5 files changed

+14693
-15522
lines changed

5 files changed

+14693
-15522
lines changed

content/en/altinity-kb-integrations/altinity-kb-kafka/altinity-kb-adjusting-librdkafka-settings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ kafkacat -b my_broker:9092 -C -o -10 -t my_topic \
148148

149149
```
150150

151-
# Different configurations for different tables?
151+
## Different configurations for different tables?
152152

153153
> Is there some more documentation how to use this multiconfiguration for Kafka ?
154154
@@ -180,7 +180,7 @@ And after that in configuration:
180180
</clickhouse>
181181

182182

183-
<yandex>
183+
<clickhouse>
184184
<named_collections>
185185
<kafka_preset1>
186186
<kafka_broker_list>...</kafka_broker_list>
@@ -197,7 +197,7 @@ And after that in configuration:
197197
</kafka>
198198
</kafka_preset1>
199199
</named_collections>
200-
</yandex>
200+
</clickhouse>
201201

202202
```
203203

content/en/altinity-kb-schema-design/change-order-by.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,24 @@ ORDER BY (column1, column2, column3)
3737

3838
4. Copy data from `example_table_old` into `example_table_temp`
3939

40-
a. Use this query to generate a list of INSERT statements
40+
a. Use this query to generate a list of INSERT statements
4141
```sql
42+
-- old Clickhouse versions before a support of `where _partition_id`
4243
select concat('insert into example_table_temp select * from example_table_old where toYYYYMM(date)=',partition) as cmd,
4344
database, table, partition, sum(rows), sum(bytes_on_disk), count()
4445
from system.parts
4546
where database='default' and table='example_table_old'
4647
group by database, table, partition
4748
order by partition
49+
50+
-- newer Clickhouse versions with a support of `where _partition_id`
51+
select concat('insert into example_table_temp select * from ', table,' where _partition_id = \'',partition_id, '\';') as cmd,
52+
database, table, partition, sum(rows), sum(bytes_on_disk), count()
53+
from system.parts
54+
where database='default' and table='example_table_old'
55+
group by database, table, partition_id, partition
56+
order by partition_id
57+
4858
```
4959

5060
b. Create an intermediate table
@@ -70,7 +80,7 @@ ORDER BY (column1, column2, column3)
7080
order by partition
7181
```
7282

73-
5. Attach data from the intermediate table to `example_table`
83+
6. Attach data from the intermediate table to `example_table`
7484

7585
a. Use this query to generate a list of ATTACH statements
7686
```sql
@@ -93,5 +103,5 @@ ORDER BY (column1, column2, column3)
93103
order by partition
94104
```
95105

96-
6. Drop `example_table_old` and `example_table_temp`
106+
7. Drop `example_table_old` and `example_table_temp`
97107

content/en/altinity-kb-setup-and-maintenance/altinity-kb-data-migration/add_remove_replica.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ SELECT
5959
replaceRegexpOne(replaceOne(concat(create_table_query, ';'), '(', 'ON CLUSTER \'{cluster}\' ('), 'CREATE (TABLE|DICTIONARY|VIEW|LIVE VIEW|WINDOW VIEW)', 'CREATE \\1 IF NOT EXISTS')
6060
FROM
6161
system.tables
62-
WHERE
62+
WHERE engine != 'MaterializedView' and
6363
database NOT IN ('system', 'information_schema', 'INFORMATION_SCHEMA') AND
6464
create_table_query != '' AND
6565
name NOT LIKE '.inner.%%' AND
@@ -72,7 +72,7 @@ SELECT
7272
replaceRegexpOne(replaceOne(concat(create_table_query, ';'), 'TO', 'ON CLUSTER \'{cluster}\' TO'), '(CREATE MATERIALIZED VIEW)', '\\1 IF NOT EXISTS')
7373
FROM
7474
system.tables
75-
WHERE
75+
WHERE engine = 'MaterializedView' and
7676
database NOT IN ('system', 'information_schema', 'INFORMATION_SCHEMA') AND
7777
create_table_query != '' AND
7878
name NOT LIKE '.inner.%%' AND
@@ -101,9 +101,9 @@ clickhouse-client --host localhost --port 9000 -mn < schema.sql
101101
- Using `clickhouse-backup` to copy the schema of a replica to another is also convenient and moreover if [using Atomic database](/engines/altinity-kb-atomic-database-engine/) with `{uuid}` macros in [ReplicatedMergeTree engines](https://www.youtube.com/watch?v=oHwhXc0re6k):
102102

103103
```bash
104-
sudo -u clickhouse clickhouse-backup --schema --rbac create_remote full-replica
104+
sudo -u clickhouse clickhouse-backup create --schema --rbac rbac_and_schema
105105
# From the destination replica
106-
sudo -u clickhouse clickhouse-backup --schema --rbac restore_remote full-replica
106+
sudo -u clickhouse clickhouse-backup restore --schema --rbac rbac_and_schema
107107
```
108108

109109
### Using `altinity operator`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}{{ if strings.Contains .Destination "clickhouse.com" }} rel="nofollow" {{ end }}{{ if strings.Contains .Destination "clickhouse.tech" }} rel="nofollow" {{ end }}>{{ .Text }}</a>
1+
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}{{ if strings.Contains .Destination "clickhouse.com" }} rel="nofollow" {{ end }}{{ if strings.Contains .Destination "clickhouse.tech" }} rel="nofollow" {{ end }}>{{ .Text }}</a>

0 commit comments

Comments
 (0)