ClickHouse/src/Processors/Transforms/CopyTransform.h

29 lines
602 B
C++
Raw Normal View History

2020-04-22 13:52:07 +00:00
#pragma once
#include <Processors/IProcessor.h>
namespace DB
{
/// Transform which has single input and num_outputs outputs.
/// Read chunk from input and copy it to all outputs.
class CopyTransform : public IProcessor
{
public:
CopyTransform(const Block & header, size_t num_outputs);
String getName() const override { return "Copy"; }
Status prepare() override;
InputPort & getInputPort() { return inputs.front(); }
private:
Chunk chunk;
bool has_data = false;
std::vector<char> was_output_processed;
Status prepareGenerate();
Status prepareConsume();
};
}