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
|
|
|
|
|
2024-02-28 20:40:17 +00:00
|
|
|
#include <Client/Connection.h>
|
2021-04-08 00:09:15 +00:00
|
|
|
#include <Interpreters/Cluster.h>
|
|
|
|
#include <IO/S3Common.h>
|
2023-01-09 12:30:32 +00:00
|
|
|
#include <Storages/IStorageCluster.h>
|
2021-04-08 00:09:15 +00:00
|
|
|
#include <Storages/StorageS3.h>
|
2021-03-19 21:49:18 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
2023-01-09 12:30:32 +00:00
|
|
|
class StorageS3Cluster : public IStorageCluster
|
2021-03-19 21:49:18 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-12 21:42:52 +00:00
|
|
|
StorageS3Cluster(
|
2023-04-21 17:24:37 +00:00
|
|
|
const String & cluster_name_,
|
|
|
|
const StorageS3::Configuration & configuration_,
|
2021-04-23 12:18:23 +00:00
|
|
|
const StorageID & table_id_,
|
|
|
|
const ColumnsDescription & columns_,
|
|
|
|
const ConstraintsDescription & constraints_,
|
2024-01-22 22:55:50 +00:00
|
|
|
const 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"; }
|
|
|
|
|
2024-01-02 17:14:16 +00:00
|
|
|
RemoteQueryExecutor::Extension getTaskIteratorExtension(const ActionsDAG::Node * predicate, const ContextPtr & context) const override;
|
2023-01-09 12:30:32 +00:00
|
|
|
|
2023-07-04 16:50:31 +00:00
|
|
|
bool supportsSubcolumns() const override { return true; }
|
|
|
|
|
2023-08-21 12:30:52 +00:00
|
|
|
bool supportsTrivialCountOptimization() const override { return true; }
|
|
|
|
|
2023-03-28 13:39:59 +00:00
|
|
|
protected:
|
|
|
|
void updateConfigurationIfChanged(ContextPtr local_context);
|
|
|
|
|
2021-03-19 21:49:18 +00:00
|
|
|
private:
|
2023-04-21 17:24:37 +00:00
|
|
|
void updateBeforeRead(const ContextPtr & context) override { updateConfigurationIfChanged(context); }
|
|
|
|
|
2024-01-22 22:55:50 +00:00
|
|
|
void updateQueryToSendIfNeeded(ASTPtr & query, const StorageSnapshotPtr & storage_snapshot, const ContextPtr & context) override;
|
2023-04-24 13:20:04 +00:00
|
|
|
|
2023-02-06 14:36:47 +00:00
|
|
|
StorageS3::Configuration s3_configuration;
|
2021-03-19 21:49:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2021-03-24 21:02:21 +00:00
|
|
|
|
|
|
|
#endif
|