ClickHouse/src/Processors/QueryPlan/UnionStep.h
2023-09-14 15:04:37 +02:00

32 lines
853 B
C++

#pragma once
#include <Processors/QueryPlan/IQueryPlanStep.h>
namespace DB
{
/// Unite several logical streams of data into single logical stream with specified structure.
class UnionStep : public IQueryPlanStep
{
public:
/// max_threads is used to limit the number of threads for result pipeline.
explicit UnionStep(DataStreams input_streams_, size_t max_threads_ = 0);
String getName() const override { return "Union"; }
QueryPipelineBuilderPtr updatePipeline(QueryPipelineBuilders pipelines, const BuildQueryPipelineSettings &) override;
void describePipeline(FormatSettings & settings) const override;
size_t getMaxThreads() const { return max_threads; }
bool canUpdateInputStream() const override { return true; }
private:
void updateOutputStream() override;
Block header;
size_t max_threads;
};
}