| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <ext/shared_ptr_helper.h> |
| 4 | #include <Storages/IStorage.h> |
| 5 | |
| 6 | |
| 7 | namespace DB |
| 8 | { |
| 9 | /* One block storage used for values table function |
| 10 | * It's structure is similar to IStorageSystemOneBlock |
| 11 | */ |
| 12 | class StorageValues : public ext::shared_ptr_helper<StorageValues>, public IStorage |
| 13 | { |
| 14 | friend struct ext::shared_ptr_helper<StorageValues>; |
| 15 | public: |
| 16 | std::string getName() const override { return "Values"; } |
| 17 | std::string getTableName() const override { return table_name; } |
| 18 | std::string getDatabaseName() const override { return database_name; } |
| 19 | |
| 20 | BlockInputStreams read( |
| 21 | const Names & column_names, |
| 22 | const SelectQueryInfo & query_info, |
| 23 | const Context & context, |
| 24 | QueryProcessingStage::Enum processed_stage, |
| 25 | size_t max_block_size, |
| 26 | unsigned num_streams) override; |
| 27 | |
| 28 | private: |
| 29 | std::string database_name; |
| 30 | std::string table_name; |
| 31 | Block res_block; |
| 32 | |
| 33 | protected: |
| 34 | StorageValues(const std::string & database_name_, const std::string & table_name_, const ColumnsDescription & columns_, const Block & res_block_); |
| 35 | }; |
| 36 | |
| 37 | } |
| 38 |