2020-06-12 04:21:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-08-07 16:14:10 +00:00
|
|
|
#include "config_core.h"
|
|
|
|
|
|
|
|
#if USE_MYSQL
|
|
|
|
|
2020-06-12 04:21:43 +00:00
|
|
|
#include <Storages/IStorage.h>
|
2020-08-06 11:56:49 +00:00
|
|
|
#include <Databases/MySQL/DatabaseMaterializeMySQL.h>
|
2020-06-12 04:21:43 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class StorageMaterializeMySQL final : public ext::shared_ptr_helper<StorageMaterializeMySQL>, public IStorage
|
|
|
|
{
|
|
|
|
friend struct ext::shared_ptr_helper<StorageMaterializeMySQL>;
|
|
|
|
public:
|
2020-08-06 11:56:49 +00:00
|
|
|
String getName() const override { return "MaterializeMySQL"; }
|
2020-06-12 04:21:43 +00:00
|
|
|
|
|
|
|
bool supportsFinal() const override { return nested_storage->supportsFinal(); }
|
|
|
|
bool supportsSampling() const override { return nested_storage->supportsSampling(); }
|
|
|
|
|
2020-08-06 11:56:49 +00:00
|
|
|
StorageMaterializeMySQL(const StoragePtr & nested_storage_, const DatabaseMaterializeMySQL * database_);
|
2020-06-12 04:21:43 +00:00
|
|
|
|
2020-08-14 05:28:26 +00:00
|
|
|
Pipe read(
|
2020-07-01 05:00:50 +00:00
|
|
|
const Names & column_names, const StorageMetadataPtr & metadata_snapshot, const SelectQueryInfo & query_info,
|
2020-06-12 04:21:43 +00:00
|
|
|
const Context & context, QueryProcessingStage::Enum processed_stage, size_t max_block_size, unsigned num_streams) override;
|
|
|
|
|
2020-06-24 05:28:27 +00:00
|
|
|
NamesAndTypesList getVirtuals() const override;
|
|
|
|
|
2020-06-12 04:21:43 +00:00
|
|
|
private:
|
|
|
|
StoragePtr nested_storage;
|
2020-08-06 11:56:49 +00:00
|
|
|
const DatabaseMaterializeMySQL * database;
|
2020-06-12 04:21:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2020-08-07 16:14:10 +00:00
|
|
|
|
|
|
|
#endif
|