ClickHouse
38 строк · 1.0 Кб
1#include <Processors/Formats/IInputFormat.h>
2#include <Processors/QueryPlan/ReadFromPreparedSource.h>
3#include <Processors/SourceWithKeyCondition.h>
4#include <QueryPipeline/QueryPipelineBuilder.h>
5
6namespace DB
7{
8
9ReadFromPreparedSource::ReadFromPreparedSource(Pipe pipe_)
10: ISourceStep(DataStream{.header = pipe_.getHeader()})
11, pipe(std::move(pipe_))
12{
13}
14
15void ReadFromPreparedSource::initializePipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &)
16{
17for (const auto & processor : pipe.getProcessors())
18processors.emplace_back(processor);
19
20pipeline.init(std::move(pipe));
21}
22
23ReadFromStorageStep::ReadFromStorageStep(
24Pipe pipe_,
25String storage_name,
26ContextPtr context_,
27const SelectQueryInfo & query_info_)
28: ReadFromPreparedSource(std::move(pipe_))
29, context(std::move(context_))
30, query_info(query_info_)
31{
32setStepDescription(storage_name);
33
34for (const auto & processor : pipe.getProcessors())
35processor->setStorageLimits(query_info.storage_limits);
36}
37
38}
39