Add FillingStep

This commit is contained in:
Nikolai Kochetov 2020-06-17 22:20:30 +03:00
parent 7fcea660de
commit d795b2b037
4 changed files with 47 additions and 4 deletions

View File

@ -92,6 +92,7 @@
#include <Processors/QueryPlan/TotalsHavingStep.h>
#include <Processors/QueryPlan/RollupStep.h>
#include <Processors/QueryPlan/CubeStep.h>
#include <Processors/QueryPlan/FillingStep.h>
namespace DB
@ -1788,10 +1789,8 @@ void InterpreterSelectQuery::executeWithFill(QueryPipeline & pipeline)
if (fill_descr.empty())
return;
pipeline.addSimpleTransform([&](const Block & header)
{
return std::make_shared<FillingTransform>(header, fill_descr);
});
FillingStep filling_step(DataStream{.header = pipeline.getHeader()}, std::move(fill_descr));
filling_step.transformPipeline(pipeline);
}
}

View File

@ -0,0 +1,22 @@
#include <Processors/QueryPlan/FillingStep.h>
#include <Processors/Transforms/FillingTransform.h>
#include <Processors/QueryPipeline.h>
namespace DB
{
FillingStep::FillingStep(const DataStream & input_stream_, SortDescription sort_description_)
: ITransformingStep(input_stream_, input_stream_)
, sort_description(std::move(sort_description_))
{
}
void FillingStep::transformPipeline(QueryPipeline & pipeline)
{
pipeline.addSimpleTransform([&](const Block & header)
{
return std::make_shared<FillingTransform>(header, sort_description);
});
}
}

View File

@ -0,0 +1,21 @@
#pragma once
#include <Processors/QueryPlan/ITransformingStep.h>
#include <Core/SortDescription.h>
namespace DB
{
class FillingStep : public ITransformingStep
{
public:
FillingStep(const DataStream & input_stream_, SortDescription sort_description_);
String getName() const override { return "Filling"; }
void transformPipeline(QueryPipeline & pipeline) override;
private:
SortDescription sort_description;
};
}

View File

@ -143,6 +143,7 @@ SRCS(
QueryPlan/CubeStep.cpp
QueryPlan/DistinctStep.cpp
QueryPlan/ExpressionStep.cpp
QueryPlan/FillingStep.cpp
QueryPlan/FilterStep.cpp
QueryPlan/ISourceStep.cpp
QueryPlan/ITransformingStep.cpp