2018-12-05 13:24:45 +00:00
|
|
|
#include <Common/config.h>
|
2019-12-15 06:34:43 +00:00
|
|
|
#include "registerTableFunctions.h"
|
2018-12-05 13:24:45 +00:00
|
|
|
|
|
|
|
#if USE_HDFS
|
2019-06-05 11:52:39 +00:00
|
|
|
#include <Storages/StorageHDFS.h>
|
2019-08-01 01:53:38 +00:00
|
|
|
#include <Storages/ColumnsDescription.h>
|
2020-01-26 09:49:53 +00:00
|
|
|
#include <Access/AccessType.h>
|
2018-11-19 08:17:09 +00:00
|
|
|
#include <TableFunctions/TableFunctionFactory.h>
|
2019-06-05 11:52:39 +00:00
|
|
|
#include <TableFunctions/TableFunctionHDFS.h>
|
2018-11-19 08:17:09 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
StoragePtr TableFunctionHDFS::getStorage(
|
2019-11-19 12:46:07 +00:00
|
|
|
const String & source, const String & format, const ColumnsDescription & columns, Context & global_context, const std::string & table_name, const String & compression_method) const
|
2018-11-19 08:17:09 +00:00
|
|
|
{
|
|
|
|
return StorageHDFS::create(source,
|
2019-12-04 16:06:55 +00:00
|
|
|
StorageID(getDatabaseName(), table_name),
|
2018-11-19 08:17:09 +00:00
|
|
|
format,
|
2019-08-01 01:53:38 +00:00
|
|
|
columns,
|
2019-08-24 21:20:20 +00:00
|
|
|
ConstraintsDescription{},
|
2019-11-19 12:46:07 +00:00
|
|
|
global_context,
|
|
|
|
compression_method);
|
2018-11-19 08:17:09 +00:00
|
|
|
}
|
|
|
|
|
2020-01-24 16:20:36 +00:00
|
|
|
AccessType TableFunctionHDFS::getRequiredAccessType() const
|
|
|
|
{
|
|
|
|
return AccessType::hdfs;
|
|
|
|
}
|
|
|
|
|
2019-12-15 06:34:43 +00:00
|
|
|
#if USE_HDFS
|
2018-11-19 08:17:09 +00:00
|
|
|
void registerTableFunctionHDFS(TableFunctionFactory & factory)
|
|
|
|
{
|
|
|
|
factory.registerFunction<TableFunctionHDFS>();
|
|
|
|
}
|
2019-12-15 06:34:43 +00:00
|
|
|
#endif
|
2018-11-19 08:17:09 +00:00
|
|
|
}
|
2018-12-05 13:24:45 +00:00
|
|
|
#endif
|