1#pragma once
2
3#include <Common/config.h>
4
5#if USE_AWS_S3
6
7#include <TableFunctions/ITableFunction.h>
8
9
10namespace DB
11{
12
13class Context;
14
15/* s3(source, [access_key_id, secret_access_key,] format, structure) - creates a temporary storage for a file in S3
16 */
17class TableFunctionS3 : public ITableFunction
18{
19public:
20 static constexpr auto name = "s3";
21 std::string getName() const override
22 {
23 return name;
24 }
25
26private:
27 StoragePtr executeImpl(
28 const ASTPtr & ast_function,
29 const Context & context,
30 const std::string & table_name) const override;
31
32 StoragePtr getStorage(
33 const String & source,
34 const String & access_key_id,
35 const String & secret_access_key,
36 const String & format,
37 const ColumnsDescription & columns,
38 Context & global_context,
39 const std::string & table_name,
40 const String & compression_method) const;
41};
42
43}
44
45#endif
46