2020-06-17 16:54:51 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/QueryPlan/ITransformingStep.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-11-03 11:28:28 +00:00
|
|
|
class ActionsDAG;
|
|
|
|
using ActionsDAGPtr = std::shared_ptr<ActionsDAG>;
|
2020-06-17 16:54:51 +00:00
|
|
|
|
|
|
|
enum class TotalsMode;
|
|
|
|
|
2020-06-22 10:18:28 +00:00
|
|
|
/// Execute HAVING and calculate totals. See TotalsHavingTransform.
|
2020-06-17 16:54:51 +00:00
|
|
|
class TotalsHavingStep : public ITransformingStep
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TotalsHavingStep(
|
|
|
|
const DataStream & input_stream_,
|
|
|
|
bool overflow_row_,
|
2020-11-11 16:52:27 +00:00
|
|
|
const ActionsDAGPtr & actions_dag_,
|
2020-06-17 16:54:51 +00:00
|
|
|
const std::string & filter_column_,
|
|
|
|
TotalsMode totals_mode_,
|
|
|
|
double auto_include_threshold_,
|
|
|
|
bool final_);
|
|
|
|
|
|
|
|
String getName() const override { return "TotalsHaving"; }
|
|
|
|
|
2021-03-04 17:38:12 +00:00
|
|
|
void transformPipeline(QueryPipeline & pipeline, const BuildQueryPipelineSettings & settings) override;
|
2020-06-17 16:54:51 +00:00
|
|
|
|
2021-04-16 16:36:59 +00:00
|
|
|
void describeActions(JSONBuilder::JSONMap & map) const override;
|
2020-06-27 14:02:24 +00:00
|
|
|
void describeActions(FormatSettings & settings) const override;
|
2020-06-24 12:09:01 +00:00
|
|
|
|
2021-02-18 13:13:09 +00:00
|
|
|
const ActionsDAGPtr & getActions() const { return actions_dag; }
|
|
|
|
|
2020-06-17 16:54:51 +00:00
|
|
|
private:
|
|
|
|
bool overflow_row;
|
2020-11-11 16:52:27 +00:00
|
|
|
ActionsDAGPtr actions_dag;
|
2020-06-17 16:54:51 +00:00
|
|
|
String filter_column_name;
|
|
|
|
TotalsMode totals_mode;
|
|
|
|
double auto_include_threshold;
|
|
|
|
bool final;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|