2021-03-19 21:49:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-09-28 08:45:15 +00:00
|
|
|
#include "config.h"
|
2021-03-24 21:02:21 +00:00
|
|
|
|
|
|
|
#if USE_AWS_S3
|
|
|
|
|
2021-06-15 19:55:21 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <optional>
|
|
|
|
|
2021-03-19 21:49:18 +00:00
|
|
|
#include "Client/Connection.h"
|
2021-04-08 00:09:15 +00:00
|
|
|
#include <Interpreters/Cluster.h>
|
|
|
|
#include <IO/S3Common.h>
|
|
|
|
#include <Storages/StorageS3.h>
|
2021-03-19 21:49:18 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
2022-10-07 13:53:30 +00:00
|
|
|
class StorageS3Cluster : public IStorage
|
2021-03-19 21:49:18 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-12 21:42:52 +00:00
|
|
|
StorageS3Cluster(
|
2022-09-13 13:07:43 +00:00
|
|
|
const StorageS3ClusterConfiguration & configuration_,
|
2021-04-23 12:18:23 +00:00
|
|
|
const StorageID & table_id_,
|
|
|
|
const ColumnsDescription & columns_,
|
|
|
|
const ConstraintsDescription & constraints_,
|
2022-09-13 13:07:43 +00:00
|
|
|
ContextPtr context_);
|
2021-03-19 21:49:18 +00:00
|
|
|
|
2022-04-19 20:47:29 +00:00
|
|
|
std::string getName() const override { return "S3Cluster"; }
|
|
|
|
|
|
|
|
Pipe read(const Names &, const StorageSnapshotPtr &, SelectQueryInfo &,
|
2022-10-07 10:46:45 +00:00
|
|
|
ContextPtr, QueryProcessingStage::Enum, size_t /*max_block_size*/, size_t /*num_streams*/) override;
|
2022-04-19 20:47:29 +00:00
|
|
|
|
|
|
|
QueryProcessingStage::Enum
|
|
|
|
getQueryProcessingStage(ContextPtr, QueryProcessingStage::Enum, const StorageSnapshotPtr &, SelectQueryInfo &) const override;
|
|
|
|
|
|
|
|
NamesAndTypesList getVirtuals() const override;
|
|
|
|
|
2021-03-19 21:49:18 +00:00
|
|
|
private:
|
2022-04-03 22:33:59 +00:00
|
|
|
StorageS3::S3Configuration s3_configuration;
|
2022-10-07 13:53:30 +00:00
|
|
|
|
2021-04-06 19:18:45 +00:00
|
|
|
String filename;
|
2021-04-12 19:35:26 +00:00
|
|
|
String cluster_name;
|
2021-03-22 17:12:31 +00:00
|
|
|
String format_name;
|
|
|
|
String compression_method;
|
2022-05-19 11:18:58 +00:00
|
|
|
NamesAndTypesList virtual_columns;
|
|
|
|
Block virtual_block;
|
2022-10-18 13:05:40 +00:00
|
|
|
bool add_columns_structure_to_query = false;
|
2021-03-19 21:49:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2021-03-24 21:02:21 +00:00
|
|
|
|
|
|
|
#endif
|