2020-06-18 17:45:00 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/QueryPlan/IQueryPlanStep.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-06-22 10:18:28 +00:00
|
|
|
/// Unite several logical streams of data into single logical stream with specified structure.
|
2020-06-18 17:45:00 +00:00
|
|
|
class UnionStep : public IQueryPlanStep
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// max_threads is used to limit the number of threads for result pipeline.
|
2021-03-25 09:57:14 +00:00
|
|
|
explicit UnionStep(DataStreams input_streams_, size_t max_threads_ = 0);
|
2020-06-18 17:45:00 +00:00
|
|
|
|
|
|
|
String getName() const override { return "Union"; }
|
|
|
|
|
2021-09-14 16:28:41 +00:00
|
|
|
QueryPipelineBuilderPtr updatePipeline(QueryPipelineBuilders pipelines, const BuildQueryPipelineSettings &) override;
|
2020-06-18 17:45:00 +00:00
|
|
|
|
2020-06-25 09:39:17 +00:00
|
|
|
void describePipeline(FormatSettings & settings) const override;
|
|
|
|
|
2021-03-25 18:11:54 +00:00
|
|
|
size_t getMaxThreads() const { return max_threads; }
|
|
|
|
|
2020-06-18 17:45:00 +00:00
|
|
|
private:
|
|
|
|
Block header;
|
|
|
|
size_t max_threads;
|
2020-06-25 09:39:17 +00:00
|
|
|
Processors processors;
|
2020-06-18 17:45:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|