v.24.12New Feature

Added support for attaching MergeTree tables as ReplicatedMergeTree and vice versa

Added a query that allows to attach MergeTree tables as ReplicatedMergeTree and vice versa: ATTACH TABLE ... AS REPLICATED and ATTACH TABLE ... AS NOT REPLICATED. #65401 (Kirill).
Added support for attaching MergeTree tables as ReplicatedMergeTree tables and vice versa using new syntax: ATTACH TABLE ... AS REPLICATED and ATTACH TABLE ... AS NOT REPLICATED.

Why it matters

This feature allows users to convert table replication status at the time of attaching existing tables without needing to recreate or migrate data manually. It simplifies management of replication for MergeTree tables, enabling smoother transitions between replicated and non-replicated table configurations.

How to use it

When attaching a table, append the clauses AS REPLICATED to attach it as a ReplicatedMergeTree table, or use AS NOT REPLICATED to attach it as a regular MergeTree table. Example:

ATTACH TABLE my_table AS REPLICATED

or
ATTACH TABLE my_table AS NOT REPLICATED