2020-06-17 16:54:51 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/QueryPlan/ITransformingStep.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ExpressionActions;
|
|
|
|
using ExpressionActionsPtr = std::shared_ptr<ExpressionActions>;
|
|
|
|
|
|
|
|
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_,
|
|
|
|
const ExpressionActionsPtr & expression_,
|
|
|
|
const std::string & filter_column_,
|
|
|
|
TotalsMode totals_mode_,
|
|
|
|
double auto_include_threshold_,
|
|
|
|
bool final_);
|
|
|
|
|
|
|
|
String getName() const override { return "TotalsHaving"; }
|
|
|
|
|
|
|
|
void transformPipeline(QueryPipeline & pipeline) override;
|
|
|
|
|
2020-06-27 14:02:24 +00:00
|
|
|
void describeActions(FormatSettings & settings) const override;
|
2020-06-24 12:09:01 +00:00
|
|
|
|
2020-06-17 16:54:51 +00:00
|
|
|
private:
|
|
|
|
bool overflow_row;
|
|
|
|
ExpressionActionsPtr expression;
|
|
|
|
String filter_column_name;
|
|
|
|
TotalsMode totals_mode;
|
|
|
|
double auto_include_threshold;
|
|
|
|
bool final;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|