#pragma once #include #if USE_AWS_S3 #include #include namespace DB { class Context; /* s3(source, [access_key_id, secret_access_key,] format, structure[, compression]) - creates a temporary storage for a file in S3. */ class TableFunctionS3 : public ITableFunction { public: static constexpr auto name = "s3"; std::string getName() const override { return name; } bool hasStaticStructure() const override { return s3_configuration->structure != "auto"; } protected: StoragePtr executeImpl( const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription cached_columns) const override; const char * getStorageTypeName() const override { return "S3"; } ColumnsDescription getActualTableStructure(ContextPtr context) const override; void parseArguments(const ASTPtr & ast_function, ContextPtr context) override; std::optional s3_configuration; }; class TableFunctionCOS : public TableFunctionS3 { public: static constexpr auto name = "cosn"; std::string getName() const override { return name; } private: const char * getStorageTypeName() const override { return "COSN"; } }; } #endif