ClickHouse/dbms/TableFunctions/TableFunctionHDFS.cpp

38 lines
976 B
C++
Raw Normal View History

#include <Common/config.h>
2019-12-15 06:34:43 +00:00
#include "registerTableFunctions.h"
#if USE_HDFS
#include <Storages/StorageHDFS.h>
2019-08-01 01:53:38 +00:00
#include <Storages/ColumnsDescription.h>
#include <Access/AccessType.h>
2018-11-19 08:17:09 +00:00
#include <TableFunctions/TableFunctionFactory.h>
#include <TableFunctions/TableFunctionHDFS.h>
2018-11-19 08:17:09 +00:00
namespace DB
{
StoragePtr TableFunctionHDFS::getStorage(
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{},
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
}
#endif