v.20.8Improvement

Unfold database, table, and uuid macros in ReplicatedMergeTree arguments on table creation

Unfold {database}, {table} and {uuid} macros in ReplicatedMergeTree arguments on table creation. #16159 (tavplubix).
Unfold {database}, {table}, and {uuid} macros in ReplicatedMergeTree arguments during table creation.

Why it matters

This feature simplifies the configuration of ReplicatedMergeTree tables by allowing automatic expansion of common macros ({database}, {table}, {uuid}) in the table engine arguments. It reduces manual errors and improves flexibility when defining replication paths and IDs.

How to use it

When creating a ReplicatedMergeTree table, include the macros {database}, {table}, or {uuid} in the engine arguments. These macros will be automatically replaced with the actual database name, table name, or table UUID respectively during table creation. For example:

CREATE TABLE db_name.table_name (
...
) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/{table}', '{uuid}')