2018-04-06 12:10:22 +00:00
|
|
|
#include <Storages/StorageFile.h>
|
2019-08-01 01:53:38 +00:00
|
|
|
#include <Storages/ColumnsDescription.h>
|
2020-01-26 09:49:53 +00:00
|
|
|
#include <Access/AccessFlags.h>
|
2018-06-11 12:13:00 +00:00
|
|
|
#include <TableFunctions/TableFunctionFactory.h>
|
|
|
|
#include <TableFunctions/TableFunctionFile.h>
|
2020-05-20 20:16:32 +00:00
|
|
|
#include <Interpreters/Context.h>
|
2019-12-15 06:34:43 +00:00
|
|
|
#include "registerTableFunctions.h"
|
2018-04-02 11:43:37 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2018-06-11 12:13:00 +00:00
|
|
|
StoragePtr TableFunctionFile::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 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-04-02 11:43:37 +00:00
|
|
|
|
2018-06-11 12:13:00 +00:00
|
|
|
void registerTableFunctionFile(TableFunctionFactory & factory)
|
|
|
|
{
|
|
|
|
factory.registerFunction<TableFunctionFile>();
|
|
|
|
}
|
2018-04-02 11:43:37 +00:00
|
|
|
}
|