mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
34 lines
918 B
C++
34 lines
918 B
C++
#pragma once
|
|
#include <Processors/QueryPlan/ITransformingStep.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Executes LIMIT BY for specified columns. See LimitByTransform.
|
|
class LimitByStep : public ITransformingStep
|
|
{
|
|
public:
|
|
explicit LimitByStep(
|
|
const DataStream & input_stream_,
|
|
size_t group_length_, size_t group_offset_, const Names & columns_);
|
|
|
|
String getName() const override { return "LimitBy"; }
|
|
|
|
void transformPipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &) override;
|
|
|
|
void describeActions(JSONBuilder::JSONMap & map) const override;
|
|
void describeActions(FormatSettings & settings) const override;
|
|
|
|
private:
|
|
void updateOutputStream() override
|
|
{
|
|
output_stream = createOutputStream(input_streams.front(), input_streams.front().header, getDataStreamTraits());
|
|
}
|
|
|
|
size_t group_length;
|
|
size_t group_offset;
|
|
Names columns;
|
|
};
|
|
|
|
}
|