2020-12-10 22:16:58 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/QueryPlan/ITransformingStep.h>
|
|
|
|
|
2021-01-30 01:16:44 +00:00
|
|
|
#include <Interpreters/WindowDescription.h>
|
2020-12-15 00:36:03 +00:00
|
|
|
|
2020-12-10 22:16:58 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ActionsDAG;
|
|
|
|
using ActionsDAGPtr = std::shared_ptr<ActionsDAG>;
|
|
|
|
|
|
|
|
class WindowTransform;
|
|
|
|
|
|
|
|
class WindowStep : public ITransformingStep
|
|
|
|
{
|
|
|
|
public:
|
2020-12-15 00:36:03 +00:00
|
|
|
explicit WindowStep(const DataStream & input_stream_,
|
|
|
|
const WindowDescription & window_description_,
|
|
|
|
const std::vector<WindowFunctionDescription> & window_functions_);
|
|
|
|
|
2020-12-18 17:13:28 +00:00
|
|
|
String getName() const override { return "Window"; }
|
2020-12-10 22:16:58 +00:00
|
|
|
|
2021-09-14 16:28:41 +00:00
|
|
|
void transformPipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &) override;
|
2020-12-10 22:16:58 +00:00
|
|
|
|
2021-04-16 16:36:59 +00:00
|
|
|
void describeActions(JSONBuilder::JSONMap & map) const override;
|
2020-12-24 09:09:35 +00:00
|
|
|
void describeActions(FormatSettings & settings) const override;
|
2020-12-10 22:16:58 +00:00
|
|
|
|
2022-04-20 13:33:31 +00:00
|
|
|
const WindowDescription & getWindowDescription() const;
|
2021-11-02 15:40:37 +00:00
|
|
|
|
2020-12-10 22:16:58 +00:00
|
|
|
private:
|
2022-06-27 11:16:52 +00:00
|
|
|
void updateOutputStream() override;
|
|
|
|
|
2020-12-15 00:36:03 +00:00
|
|
|
WindowDescription window_description;
|
|
|
|
std::vector<WindowFunctionDescription> window_functions;
|
2020-12-10 22:16:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|