Closed barazbay closed 2 years ago
for current version as workarodund try to use Replicated
database engine
https://clickhouse.com/docs/en/engines/database-engines/replicated/
@barazbay do you understand properly restore not replicated MergeTree table data ON CLUSTER is not possible? Only Schema
If we create table, for example CREATE TABLE recipes ON CLUSTER '{cluster}' ( title String, ingredients Array(String), directions Array(String), link String, source LowCardinality(String), NER Array(String) ) ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{shard}/test.recipes', '{replica}') ORDER BY title;
backup metadata will be ATTACH TABLE recipes (
title
String,ingredients
Array(String),directions
Array(String),link
String,source
LowCardinality(String),NER
Array(String) ) ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{shard}/test.recipes', '{replica}') ORDER BY title SETTINGS index_granularity = 8192nothing new, SHOW CREATE TABLE is show create table recipes\G
SHOW CREATE TABLE recipes
Row 1: ────── statement: CREATE TABLE test.recipes (
title
String,ingredients
Array(String),directions
Array(String),link
String,source
LowCardinality(String),NER
Array(String) ) ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{shard}/test.recipes', '{replica}') ORDER BY title SETTINGS index_granularity = 81921 rows in set. Elapsed: 0.002 sec.
but if I want to restore ON CLUSTER as it was before, it can be easily done if I change restore meta ATTACH TABLE recipes ON CLUSTER '{cluster}' (
title
String,ingredients
Array(String),directions
Array(String),link
String,source
LowCardinality(String),NER
Array(String) ) ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{shard}/test.recipes', '{replica}') ORDER BY title SETTINGS index_granularity = 8192 ` it would be nice to add option to restore with 'ON CLUSTER