ClickHouse/src/Processors/QueryPlan/ReadFromPreparedSource.h

36 lines
842 B
C++
Raw Normal View History

2020-06-16 14:11:19 +00:00
#pragma once
#include <Processors/QueryPlan/ISourceStep.h>
#include <Processors/Pipe.h>
namespace DB
{
/// Create source from prepared pipe.
2020-06-16 14:11:19 +00:00
class ReadFromPreparedSource : public ISourceStep
{
public:
explicit ReadFromPreparedSource(Pipe pipe_, std::shared_ptr<Context> context_ = nullptr);
2020-06-16 14:11:19 +00:00
String getName() const override { return "ReadFromPreparedSource"; }
2020-06-16 14:11:19 +00:00
2021-03-04 17:38:12 +00:00
void initializePipeline(QueryPipeline & pipeline, const BuildQueryPipelineSettings &) override;
2020-06-16 14:11:19 +00:00
private:
Pipe pipe;
std::shared_ptr<Context> context;
2020-06-16 14:11:19 +00:00
};
class ReadFromStorageStep : public ReadFromPreparedSource
{
public:
2020-09-25 13:19:26 +00:00
ReadFromStorageStep(Pipe pipe_, String storage_name)
: ReadFromPreparedSource(std::move(pipe_))
{
setStepDescription(storage_name);
}
String getName() const override { return "ReadFromStorage"; }
};
2020-06-16 14:11:19 +00:00
}