| 160 | |
| 161 | |
| 162 | std::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 | |
| 176 | void DiskFromAST::ensureDiskIsNotCustom(const std::string & disk_name, ContextPtr context) |
| 177 | { |
nothing calls this directly
no test coverage detected