1 | #include <Storages/StorageFile.h> |
2 | #include <Storages/ColumnsDescription.h> |
3 | #include <TableFunctions/TableFunctionFactory.h> |
4 | #include <TableFunctions/TableFunctionFile.h> |
5 | #include "registerTableFunctions.h" |
6 | |
7 | namespace DB |
8 | { |
9 | StoragePtr TableFunctionFile::getStorage( |
10 | const String & source, const String & format, const ColumnsDescription & columns, Context & global_context, const std::string & table_name, const std::string & compression_method) const |
11 | { |
12 | StorageFile::CommonArguments args{getDatabaseName(), table_name, format, compression_method, columns, ConstraintsDescription{}, global_context}; |
13 | |
14 | return StorageFile::create(source, global_context.getUserFilesPath(), args); |
15 | } |
16 | |
17 | void registerTableFunctionFile(TableFunctionFactory & factory) |
18 | { |
19 | factory.registerFunction<TableFunctionFile>(); |
20 | } |
21 | } |
22 | |