| 94 | } |
| 95 | |
| 96 | ColumnsDescription ITableFunctionFileLike::getActualTableStructure(ContextPtr context) const |
| 97 | { |
| 98 | if (arguments.structure.empty()) |
| 99 | { |
| 100 | size_t total_bytes_to_read = 0; |
| 101 | Strings paths = StorageFile::getPathsList(arguments.url, context->getUserFilesPath(), context, total_bytes_to_read); |
| 102 | if (paths.empty()) |
| 103 | throw Exception("Cannot get table structure from file, because no files match specified name", ErrorCodes::INCORRECT_FILE_NAME); |
| 104 | auto read_stream = StorageDistributedDirectoryMonitor::createSourceFromFile(paths[0]); |
| 105 | return ColumnsDescription{read_stream->getOutputs().front().getHeader().getNamesAndTypesList()}; |
| 106 | } |
| 107 | return parseColumnsListFromString(arguments.structure, context); |
| 108 | } |
| 109 | |
| 110 | StoragePtr ITableFunctionFileLike::executeImpl(const ASTPtr & /*ast_function*/, ContextPtr context, const std::string & table_name, ColumnsDescription /*cached_columns*/) const |
| 111 | { |
nothing calls this directly
no test coverage detected