mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 11:52:27 +00:00
24 lines
641 B
C++
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>();
|
|
}
|
|
}
|