mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 21:51:57 +00:00
47 lines
720 B
C++
47 lines
720 B
C++
|
#include <Processors/ConcatProcessor.h>
|
||
|
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
ConcatProcessor::Status ConcatProcessor::prepare()
|
||
|
{
|
||
|
auto & output = outputs[0];
|
||
|
|
||
|
if (output.hasData())
|
||
|
return Status::PortFull;
|
||
|
|
||
|
if (!output.isNeeded())
|
||
|
{
|
||
|
for (auto & input : inputs)
|
||
|
input.setNotNeeded();
|
||
|
|
||
|
return Status::Unneeded;
|
||
|
}
|
||
|
|
||
|
if (current_input == inputs.end())
|
||
|
return Status::Finished;
|
||
|
|
||
|
auto & input = *current_input;
|
||
|
|
||
|
input.setNeeded();
|
||
|
|
||
|
if (input.hasData())
|
||
|
{
|
||
|
output.push(input.pull());
|
||
|
}
|
||
|
|
||
|
if (input.isFinished())
|
||
|
{
|
||
|
input.setNotNeeded();
|
||
|
++current_input;
|
||
|
current_input->setNeeded();
|
||
|
}
|
||
|
|
||
|
return Status::Again;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|