| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <Processors/IProcessor.h> |
| 4 | |
| 5 | |
| 6 | namespace DB |
| 7 | { |
| 8 | |
| 9 | /** Has arbitary non zero number of inputs and one output. |
| 10 | * All of them have the same structure. |
| 11 | * |
| 12 | * Pulls all data from first input, then all data from second input, etc... |
| 13 | * Doesn't do any heavy calculations. |
| 14 | * Preserves an order of data. |
| 15 | */ |
| 16 | class ConcatProcessor : public IProcessor |
| 17 | { |
| 18 | public: |
| 19 | ConcatProcessor(const Block & header, size_t num_inputs) |
| 20 | : IProcessor(InputPorts(num_inputs, header), OutputPorts{header}), current_input(inputs.begin()) |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | String getName() const override { return "Concat"; } |
| 25 | |
| 26 | Status prepare() override; |
| 27 | |
| 28 | OutputPort & getOutputPort() { return outputs.front(); } |
| 29 | |
| 30 | private: |
| 31 | InputPorts::iterator current_input; |
| 32 | }; |
| 33 | |
| 34 | } |
| 35 | |
| 36 |