2020-06-16 14:11:19 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/QueryPlan/ISourceStep.h>
|
|
|
|
#include <Processors/Pipe.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-06-22 10:18:28 +00:00
|
|
|
/// Create source from prepared pipe.
|
2020-06-16 14:11:19 +00:00
|
|
|
class ReadFromPreparedSource : public ISourceStep
|
|
|
|
{
|
|
|
|
public:
|
2020-09-18 14:16:53 +00:00
|
|
|
explicit ReadFromPreparedSource(Pipe pipe_, std::shared_ptr<Context> context_ = nullptr);
|
2020-06-16 14:11:19 +00:00
|
|
|
|
2020-09-18 14:16:53 +00:00
|
|
|
String getName() const override { return "ReadFromPreparedSource"; }
|
2020-06-16 14:11:19 +00:00
|
|
|
|
|
|
|
void initializePipeline(QueryPipeline & pipeline) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Pipe pipe;
|
2020-06-19 13:34:40 +00:00
|
|
|
std::shared_ptr<Context> context;
|
2020-06-16 14:11:19 +00:00
|
|
|
};
|
|
|
|
|
2020-09-18 14:16:53 +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_))
|
2020-09-18 14:16:53 +00:00
|
|
|
{
|
|
|
|
setStepDescription(storage_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
String getName() const override { return "ReadFromStorage"; }
|
|
|
|
};
|
|
|
|
|
2020-06-16 14:11:19 +00:00
|
|
|
}
|