ClickHouse/src/Storages/StorageMaterializedMySQL.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.4 KiB
C++
Raw Normal View History

#pragma once
#include "config.h"
#if USE_MYSQL
#include <Storages/StorageProxy.h>
namespace DB
{
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
}
class StorageMaterializedMySQL final : public StorageProxy
{
public:
StorageMaterializedMySQL(const StoragePtr & nested_storage_, const IDatabase * database_);
String getName() const override { return "MaterializedMySQL"; }
bool needRewriteQueryWithFinal(const Names & column_names) const override;
2022-05-20 19:49:31 +00:00
void read(
QueryPlan & query_plan,
const Names & column_names,
const StorageSnapshotPtr & metadata_snapshot,
SelectQueryInfo & query_info,
ContextPtr context,
QueryProcessingStage::Enum processed_stage,
size_t max_block_size, size_t num_streams) override;
2021-07-23 19:33:59 +00:00
SinkToStoragePtr write(const ASTPtr &, const StorageMetadataPtr &, ContextPtr) override { throwNotAllowed(); }
2020-06-24 05:28:27 +00:00
NamesAndTypesList getVirtuals() const override;
ColumnSizeByName getColumnSizes() const override;
2020-06-24 05:28:27 +00:00
StoragePtr getNested() const override { return nested_storage; }
void drop() override { nested_storage->drop(); }
private:
[[noreturn]] static void throwNotAllowed()
{
throw Exception("This method is not allowed for MaterializedMySQL", ErrorCodes::NOT_IMPLEMENTED);
}
StoragePtr nested_storage;
2020-09-15 13:30:30 +00:00
const IDatabase * database;
};
}
#endif