| 258 | } |
| 259 | |
| 260 | bool isReplicatedTableEngine(const ASTPtr & storage_ast) |
| 261 | { |
| 262 | const auto & storage = storage_ast->as<ASTStorage &>(); |
| 263 | const auto & engine = storage.engine->as<ASTFunction &>(); |
| 264 | |
| 265 | if (!endsWith(engine.name, "MergeTree")) |
| 266 | { |
| 267 | String storage_str = queryToString(storage_ast); |
| 268 | throw Exception( |
| 269 | "Unsupported engine was specified in " + storage_str + ", only *MergeTree engines are supported", |
| 270 | ErrorCodes::BAD_ARGUMENTS); |
| 271 | } |
| 272 | |
| 273 | return startsWith(engine.name, "Replicated"); |
| 274 | } |
| 275 | |
| 276 | ShardPriority getReplicasPriority(const Cluster::Addresses & replicas, const std::string & local_hostname, UInt8 random) |
| 277 | { |
no test coverage detected