1 | #pragma once |
---|---|
2 | |
3 | #include <TableFunctions/ITableFunctionFileLike.h> |
4 | #include <Interpreters/Context.h> |
5 | |
6 | |
7 | namespace DB |
8 | { |
9 | /* file(path, format, structure) - creates a temporary storage from file |
10 | * |
11 | * |
12 | * The file must be in the clickhouse data directory. |
13 | * The relative path begins with the clickhouse data directory. |
14 | */ |
15 | class TableFunctionFile : public ITableFunctionFileLike |
16 | { |
17 | public: |
18 | static constexpr auto name = "file"; |
19 | std::string getName() const override |
20 | { |
21 | return name; |
22 | } |
23 | |
24 | private: |
25 | StoragePtr getStorage( |
26 | const String & source, const String & format, const ColumnsDescription & columns, Context & global_context, const std::string & table_name, const std::string & compression_method) const override; |
27 | }; |
28 | } |
29 |