MCPcopy Create free account
hub / github.com/ByConity/ByConity / isReplicatedTableEngine

Function isReplicatedTableEngine

programs/copier/Internals.cpp:260–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260bool 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
276ShardPriority getReplicasPriority(const Cluster::Addresses & replicas, const std::string & local_hostname, UInt8 random)
277{

Callers 1

TaskTableMethod · 0.85

Calls 4

queryToStringFunction · 0.85
endsWithFunction · 0.50
ExceptionClass · 0.50
startsWithFunction · 0.50

Tested by

no test coverage detected