#pragma once #include #include #include #include namespace DB { class Context; class Cluster; /** Implements system table 'clusters' * that allows to obtain information about available clusters * (which may be specified in Distributed tables). */ class StorageSystemClusters final : public ext::shared_ptr_helper, public IStorageSystemOneBlock { friend struct ext::shared_ptr_helper; public: std::string getName() const override { return "SystemClusters"; } static NamesAndTypesList getNamesAndTypes(); protected: using IStorageSystemOneBlock::IStorageSystemOneBlock; using NameAndCluster = std::pair>; void fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo & query_info) const override; static void writeCluster(MutableColumns & res_columns, const NameAndCluster & name_and_cluster); }; }