2020-06-17 14:21:48 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/QueryPlan/ITransformingStep.h>
|
|
|
|
#include <DataStreams/SizeLimits.h>
|
|
|
|
#include <Storages/SelectQueryInfo.h>
|
2020-06-18 18:29:33 +00:00
|
|
|
#include <Interpreters/Aggregator.h>
|
2020-06-17 14:21:48 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
struct AggregatingTransformParams;
|
|
|
|
using AggregatingTransformParamsPtr = std::shared_ptr<AggregatingTransformParams>;
|
|
|
|
|
2020-06-22 10:18:28 +00:00
|
|
|
/// Aggregation. See AggregatingTransform.
|
2020-06-17 14:21:48 +00:00
|
|
|
class AggregatingStep : public ITransformingStep
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AggregatingStep(
|
|
|
|
const DataStream & input_stream_,
|
2020-06-18 18:29:33 +00:00
|
|
|
Aggregator::Params params_,
|
|
|
|
bool final_,
|
2020-06-17 14:21:48 +00:00
|
|
|
size_t max_block_size_,
|
|
|
|
size_t merge_threads_,
|
|
|
|
size_t temporary_data_merge_threads_,
|
|
|
|
bool storage_has_evenly_distributed_read_,
|
|
|
|
InputOrderInfoPtr group_by_info_,
|
|
|
|
SortDescription group_by_sort_description_);
|
|
|
|
|
|
|
|
String getName() const override { return "Aggregating"; }
|
|
|
|
|
2021-03-04 17:38:12 +00:00
|
|
|
void transformPipeline(QueryPipeline & pipeline, const BuildQueryPipelineSettings &) override;
|
2020-06-17 14:21:48 +00:00
|
|
|
|
2020-06-27 14:02:24 +00:00
|
|
|
void describeActions(FormatSettings &) const override;
|
2020-06-25 09:39:17 +00:00
|
|
|
void describePipeline(FormatSettings & settings) const override;
|
2020-06-23 16:06:56 +00:00
|
|
|
|
2021-02-11 08:49:12 +00:00
|
|
|
const Aggregator::Params & getParams() const { return params; }
|
|
|
|
|
2020-06-17 14:21:48 +00:00
|
|
|
private:
|
2020-06-18 18:29:33 +00:00
|
|
|
Aggregator::Params params;
|
|
|
|
bool final;
|
2020-06-17 14:21:48 +00:00
|
|
|
size_t max_block_size;
|
|
|
|
size_t merge_threads;
|
|
|
|
size_t temporary_data_merge_threads;
|
|
|
|
|
|
|
|
bool storage_has_evenly_distributed_read;
|
|
|
|
|
|
|
|
InputOrderInfoPtr group_by_info;
|
|
|
|
SortDescription group_by_sort_description;
|
2020-06-25 09:39:17 +00:00
|
|
|
|
|
|
|
Processors aggregating_in_order;
|
|
|
|
Processors aggregating_sorted;
|
|
|
|
Processors finalizing;
|
|
|
|
|
|
|
|
Processors aggregating;
|
|
|
|
|
2020-06-17 14:21:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|