MCPcopy Create free account
hub / github.com/ByConity/ByConity / updatePipeline

Method updatePipeline

src/QueryPlan/IntersectOrExceptStep.cpp:42–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42QueryPipelinePtr IntersectOrExceptStep::updatePipeline(QueryPipelines pipelines, const BuildQueryPipelineSettings &)
43{
44 auto pipeline = std::make_unique<QueryPipeline>();
45 QueryPipelineProcessorsCollector collector(*pipeline, this);
46
47 if (pipelines.empty())
48 {
49 pipeline->init(Pipe(std::make_shared<NullSource>(output_stream->header)));
50 processors = collector.detachProcessors();
51 return pipeline;
52 }
53
54 for (auto & cur_pipeline : pipelines)
55 {
56 /// Just in case.
57 if (!isCompatibleHeader(cur_pipeline->getHeader(), getOutputStream().header))
58 {
59 auto converting_dag = ActionsDAG::makeConvertingActions(
60 cur_pipeline->getHeader().getColumnsWithTypeAndName(),
61 getOutputStream().header.getColumnsWithTypeAndName(),
62 ActionsDAG::MatchColumnsMode::Name);
63
64 auto converting_actions = std::make_shared<ExpressionActions>(std::move(converting_dag));
65 cur_pipeline->addSimpleTransform([&](const Block & cur_header)
66 {
67 return std::make_shared<ExpressionTransform>(cur_header, converting_actions);
68 });
69 }
70
71 /// For the case of union.
72 cur_pipeline->addTransform(std::make_shared<ResizeProcessor>(header, cur_pipeline->getNumStreams(), 1));
73 }
74
75 *pipeline = QueryPipeline::unitePipelines(std::move(pipelines), max_threads);
76 pipeline->addTransform(std::make_shared<IntersectOrExceptTransform>(header, current_operator));
77
78 processors = collector.detachProcessors();
79 return pipeline;
80}
81
82void IntersectOrExceptStep::describePipeline(FormatSettings & settings) const
83{

Callers

nothing calls this directly

Calls 9

isCompatibleHeaderFunction · 0.85
getNumStreamsMethod · 0.80
PipeClass · 0.70
emptyMethod · 0.45
initMethod · 0.45
detachProcessorsMethod · 0.45
getHeaderMethod · 0.45
addSimpleTransformMethod · 0.45
addTransformMethod · 0.45

Tested by

no test coverage detected