ClickHouse/dbms/src/TableFunctions/TableFunctionURL.cpp

22 lines
674 B
C++
Raw Normal View History

2018-06-11 12:13:00 +00:00
#include <Storages/StorageURL.h>
2019-08-01 01:53:38 +00:00
#include <Storages/ColumnsDescription.h>
2018-06-11 12:13:00 +00:00
#include <TableFunctions/TableFunctionFactory.h>
#include <TableFunctions/TableFunctionURL.h>
#include <Poco/URI.h>
2019-08-24 21:20:20 +00:00
2018-06-11 12:13:00 +00:00
namespace DB
{
StoragePtr TableFunctionURL::getStorage(
2019-08-01 01:53:38 +00:00
const String & source, const String & format, const ColumnsDescription & columns, Context & global_context, const std::string & table_name) const
2018-06-11 12:13:00 +00:00
{
Poco::URI uri(source);
2019-08-24 21:20:20 +00:00
return StorageURL::create(uri, getDatabaseName(), table_name, format, columns, ConstraintsDescription{}, global_context);
2018-06-11 12:13:00 +00:00
}
void registerTableFunctionURL(TableFunctionFactory & factory)
{
factory.registerFunction<TableFunctionURL>();
}
}