| 1 | #include <Common/config.h> |
| 2 | #include "registerTableFunctions.h" |
| 3 | |
| 4 | #if USE_HDFS |
| 5 | #include <Storages/StorageHDFS.h> |
| 6 | #include <Storages/ColumnsDescription.h> |
| 7 | #include <TableFunctions/TableFunctionFactory.h> |
| 8 | #include <TableFunctions/TableFunctionHDFS.h> |
| 9 | |
| 10 | namespace DB |
| 11 | { |
| 12 | StoragePtr TableFunctionHDFS::getStorage( |
| 13 | const String & source, const String & format, const ColumnsDescription & columns, Context & global_context, const std::string & table_name, const String & compression_method) const |
| 14 | { |
| 15 | return StorageHDFS::create(source, |
| 16 | getDatabaseName(), |
| 17 | table_name, |
| 18 | format, |
| 19 | columns, |
| 20 | ConstraintsDescription{}, |
| 21 | global_context, |
| 22 | compression_method); |
| 23 | } |
| 24 | |
| 25 | #if USE_HDFS |
| 26 | void registerTableFunctionHDFS(TableFunctionFactory & factory) |
| 27 | { |
| 28 | factory.registerFunction<TableFunctionHDFS>(); |
| 29 | } |
| 30 | #endif |
| 31 | } |
| 32 | #endif |
| 33 | |