ClickHouse/src/TableFunctions/TableFunctionFile.cpp

24 lines
887 B
C++
Raw Normal View History

#include <Storages/StorageFile.h>
2019-08-01 01:53:38 +00:00
#include <Storages/ColumnsDescription.h>
#include <Access/AccessFlags.h>
2018-06-11 12:13:00 +00:00
#include <TableFunctions/TableFunctionFactory.h>
#include <TableFunctions/TableFunctionFile.h>
#include <Interpreters/Context.h>
2019-12-15 06:34:43 +00:00
#include "registerTableFunctions.h"
namespace DB
{
2018-06-11 12:13:00 +00:00
StoragePtr TableFunctionFile::getStorage(
const String & source, const String & format, const ColumnsDescription & columns, Context & global_context, const std::string & table_name, const std::string & compression_method) const
2018-06-11 12:13:00 +00:00
{
2019-12-04 16:06:55 +00:00
StorageFile::CommonArguments args{StorageID(getDatabaseName(), table_name), format, compression_method, columns, ConstraintsDescription{}, global_context};
2019-10-30 14:17:55 +00:00
return StorageFile::create(source, global_context.getUserFilesPath(), args);
2018-06-11 12:13:00 +00:00
}
2018-06-11 12:13:00 +00:00
void registerTableFunctionFile(TableFunctionFactory & factory)
{
factory.registerFunction<TableFunctionFile>();
}
}