2023-06-08 07:26:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#if USE_AZURE_BLOB_STORAGE
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
#include "Client/Connection.h"
|
|
|
|
#include <Interpreters/Cluster.h>
|
|
|
|
#include <Storages/IStorageCluster.h>
|
|
|
|
#include <Storages/StorageAzureBlob.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
|
|
|
class StorageAzureBlobCluster : public IStorageCluster
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StorageAzureBlobCluster(
|
|
|
|
const String & cluster_name_,
|
|
|
|
const StorageAzureBlob::Configuration & configuration_,
|
|
|
|
std::unique_ptr<AzureObjectStorage> && object_storage_,
|
|
|
|
const StorageID & table_id_,
|
|
|
|
const ColumnsDescription & columns_,
|
|
|
|
const ConstraintsDescription & constraints_,
|
2024-01-22 22:55:50 +00:00
|
|
|
const ContextPtr & context);
|
2023-06-08 07:26:30 +00:00
|
|
|
|
|
|
|
std::string getName() const override { return "AzureBlobStorageCluster"; }
|
|
|
|
|
2024-01-02 17:14:16 +00:00
|
|
|
RemoteQueryExecutor::Extension getTaskIteratorExtension(const ActionsDAG::Node * predicate, const ContextPtr & context) const override;
|
2023-06-08 07:26:30 +00:00
|
|
|
|
2023-08-21 12:30:52 +00:00
|
|
|
bool supportsSubcolumns() const override { return true; }
|
|
|
|
|
|
|
|
bool supportsTrivialCountOptimization() const override { return true; }
|
|
|
|
|
2023-06-08 07:26:30 +00:00
|
|
|
private:
|
2023-06-09 13:17:08 +00:00
|
|
|
void updateBeforeRead(const ContextPtr & /*context*/) override {}
|
2023-06-08 07:26:30 +00:00
|
|
|
|
2024-01-22 22:55:50 +00:00
|
|
|
void updateQueryToSendIfNeeded(ASTPtr & query, const StorageSnapshotPtr & storage_snapshot, const ContextPtr & context) override;
|
2023-06-08 07:26:30 +00:00
|
|
|
|
|
|
|
StorageAzureBlob::Configuration configuration;
|
|
|
|
std::unique_ptr<AzureObjectStorage> object_storage;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|