| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <Storages/IStorage.h> |
| 4 | #include <ext/shared_ptr_helper.h> |
| 5 | |
| 6 | namespace DB |
| 7 | { |
| 8 | /** Internal temporary storage for table function input(...) |
| 9 | */ |
| 10 | |
| 11 | class StorageInput : public ext::shared_ptr_helper<StorageInput>, public IStorage |
| 12 | { |
| 13 | friend struct ext::shared_ptr_helper<StorageInput>; |
| 14 | public: |
| 15 | String getName() const override { return "Input"; } |
| 16 | String getTableName() const override { return table_name; } |
| 17 | |
| 18 | /// A table will read from this stream. |
| 19 | void setInputStream(BlockInputStreamPtr input_stream_); |
| 20 | |
| 21 | BlockInputStreams read( |
| 22 | const Names & column_names, |
| 23 | const SelectQueryInfo & query_info, |
| 24 | const Context & context, |
| 25 | QueryProcessingStage::Enum processed_stage, |
| 26 | size_t max_block_size, |
| 27 | unsigned num_streams) override; |
| 28 | |
| 29 | private: |
| 30 | String table_name; |
| 31 | BlockInputStreamPtr input_stream; |
| 32 | |
| 33 | protected: |
| 34 | StorageInput(const String & table_name_, const ColumnsDescription & columns_); |
| 35 | }; |
| 36 | } |
| 37 |