ClickHouse/dbms/src/TableFunctions/TableFunctionFile.cpp
2018-06-11 15:13:00 +03:00

24 lines
641 B
C++

#include <Storages/StorageFile.h>
#include <TableFunctions/TableFunctionFactory.h>
#include <TableFunctions/TableFunctionFile.h>
namespace DB
{
StoragePtr TableFunctionFile::getStorage(
const String & source, const String & format, const Block & sample_block, Context & global_context) const
{
return StorageFile::create(source,
-1,
global_context.getUserFilesPath(),
getName(),
format,
ColumnsDescription{sample_block.getNamesAndTypesList()},
global_context);
}
void registerTableFunctionFile(TableFunctionFactory & factory)
{
factory.registerFunction<TableFunctionFile>();
}
}