v.21.12Improvements
Use shard and replica names from Replicated database arguments in ReplicatedMergeTree macros
Use shard and replica name fromReplicateddatabase arguments when expanding macros inReplicatedMergeTreearguments if these macros are not defined in config. Closes #31471. #31488 (tavplubix).
Why it matters
This feature resolves the issue where users had to explicitly define shard and replica macros in the configuration to use them inReplicatedMergeTree table arguments. By automatically expanding these macros from the Replicated database arguments, it simplifies setup and avoids configuration duplication, improving usability and reducing errors.How to use it
When creating or alteringReplicatedMergeTree tables inside a Replicated database, simply omit defining shard and replica macros in the config file. The system will automatically use shard and replica names provided in the Replicated database arguments to expand macros in the table's replication arguments.