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

Method createCustomDisk

src/Disks/DiskFromAST.cpp:162–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160
161
162std::string DiskFromAST::createCustomDisk(const ASTPtr & disk_function_ast, ContextPtr context, bool attach)
163{
164 if (!isDiskFunction(disk_function_ast))
165 throw Exception(ErrorCodes::BAD_ARGUMENTS, "Expected a disk function");
166
167 auto ast = disk_function_ast->clone();
168
169 using FlattenDiskConfigurationVisitor = InDepthNodeVisitor<DiskConfigurationFlattener, false>;
170 FlattenDiskConfigurationVisitor::Data data{context, attach};
171 FlattenDiskConfigurationVisitor{data}.visit(ast);
172
173 return assert_cast<const ASTLiteral &>(*ast).value.safeGet<String>();
174}
175
176void DiskFromAST::ensureDiskIsNotCustom(const std::string & disk_name, ContextPtr context)
177{

Callers

nothing calls this directly

Calls 4

isDiskFunctionFunction · 0.85
ExceptionClass · 0.50
cloneMethod · 0.45
visitMethod · 0.45

Tested by

no test coverage detected