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

Method parseQueryFromMetadataInZooKeeper

src/Databases/DatabaseReplicated.cpp:681–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681ASTPtr DatabaseReplicated::parseQueryFromMetadataInZooKeeper(const String & node_name, const String & query, ParserSettingsImpl dt)
682{
683 ParserCreateQuery parser(dt);
684 String description = "in ZooKeeper " + zookeeper_path + "/metadata/" + node_name;
685 auto ast = parseQuery(parser, query, description, 0, getContext()->getSettingsRef().max_parser_depth);
686
687 auto & create = ast->as<ASTCreateQuery &>();
688 if (create.uuid == UUIDHelpers::Nil || create.table != TABLE_WITH_UUID_NAME_PLACEHOLDER || !create.database.empty())
689 throw Exception(ErrorCodes::LOGICAL_ERROR, "Got unexpected query from {}: {}", node_name, query);
690
691 bool is_materialized_view_with_inner_table = create.is_materialized_view && create.to_table_id.empty();
692
693 create.database = getDatabaseName();
694 create.table = unescapeForFileName(node_name);
695 create.attach = is_materialized_view_with_inner_table;
696
697 return ast;
698}
699
700void DatabaseReplicated::drop(ContextPtr context_)
701{

Callers

nothing calls this directly

Calls 4

parseQueryFunction · 0.85
unescapeForFileNameFunction · 0.85
ExceptionClass · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected