MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / readText

Method readText

src/Storages/MutationCommands.cpp:305–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305void MutationCommands::readText(ReadBuffer & in, bool with_pure_metadata_commands)
306{
307 String commands_str;
308 readEscapedString(commands_str, in);
309
310 ParserAlterCommandList p_alter_commands;
311 auto commands_ast = parseQuery(
312 p_alter_commands, commands_str.data(), commands_str.data() + commands_str.length(), "mutation commands list", 0, DBMS_DEFAULT_MAX_PARSER_DEPTH, DBMS_DEFAULT_MAX_PARSER_BACKTRACKS);
313
314 for (const auto & child : commands_ast->children)
315 {
316 auto * command_ast = child->as<ASTAlterCommand>();
317 auto command = MutationCommand::parse(*command_ast, true, with_pure_metadata_commands);
318 if (!command)
319 throw Exception(ErrorCodes::UNKNOWN_MUTATION_COMMAND, "Unknown mutation command type: {}", DB::toString<int>(command_ast->type));
320 push_back(std::move(*command));
321 }
322}
323
324std::string MutationCommands::toString(bool with_pure_metadata_commands) const
325{

Callers

nothing calls this directly

Calls 6

readEscapedStringFunction · 0.85
parseQueryFunction · 0.85
parseFunction · 0.50
ExceptionClass · 0.50
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected