mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
28 lines
947 B
C++
28 lines
947 B
C++
#include <Storages/StorageFile.h>
|
|
#include <Storages/ColumnsDescription.h>
|
|
#include <Access/AccessFlags.h>
|
|
#include <TableFunctions/TableFunctionFactory.h>
|
|
#include <TableFunctions/TableFunctionFile.h>
|
|
#include "registerTableFunctions.h"
|
|
|
|
namespace DB
|
|
{
|
|
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
|
|
{
|
|
StorageFile::CommonArguments args{StorageID(getDatabaseName(), table_name), format, compression_method, columns, ConstraintsDescription{}, global_context};
|
|
|
|
return StorageFile::create(source, global_context.getUserFilesPath(), args);
|
|
}
|
|
|
|
AccessType TableFunctionFile::getRequiredAccessType() const
|
|
{
|
|
return AccessType::file;
|
|
}
|
|
|
|
void registerTableFunctionFile(TableFunctionFactory & factory)
|
|
{
|
|
factory.registerFunction<TableFunctionFile>();
|
|
}
|
|
}
|