Hi all,
Testing my application, I
automatically
create and destroy several tables in a cluster environment.
To create tables
CREATE TABLE IF NOT EXISTS databaseSchema.tableTestName on cluster '{cluster}' (...) ENGINE = ENGINE = ReplicatedMergeTree ('/ clickhouse / tables / {shard} / {table}', '{replica}') PARTITION ...and to eliminate
DROP TABLE IF EXISTS databaseSchema.tableTestName on cluster '{cluster}';This apparently works correctly. But when I recreate the same table (in another test) I get the error.
DB :: Exception: Replica / clickhouse / tables / 01 / STATS_USERTEST / replicas / node1 already exists. (version 20.11.4.13 (official build))
How can I avoid this error programmatically? (I have seen that I can manually delete the replica file)
Thanks