2019-02-22 17:45:56 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Processors/ISimpleTransform.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ExpressionActions;
|
|
|
|
using ExpressionActionsPtr = std::shared_ptr<ExpressionActions>;
|
|
|
|
|
|
|
|
class ExpressionTransform : public ISimpleTransform
|
|
|
|
{
|
|
|
|
public:
|
2020-01-24 17:35:17 +00:00
|
|
|
ExpressionTransform(
|
|
|
|
const Block & header_,
|
|
|
|
ExpressionActionsPtr expression_,
|
|
|
|
bool on_totals_ = false,
|
|
|
|
bool default_totals_ = false);
|
2019-02-22 17:45:56 +00:00
|
|
|
|
|
|
|
String getName() const override { return "ExpressionTransform"; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void transform(Chunk & chunk) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
ExpressionActionsPtr expression;
|
2019-04-09 14:08:52 +00:00
|
|
|
bool on_totals;
|
2020-01-24 17:35:17 +00:00
|
|
|
/// This flag means that we have manually added totals to our pipeline.
|
|
|
|
/// It may happen in case if joined subquery has totals, but out string doesn't.
|
|
|
|
/// We need to join default values with subquery totals if we have them, or return empty chunk is haven't.
|
2019-04-10 11:04:56 +00:00
|
|
|
bool default_totals;
|
2019-10-11 17:27:54 +00:00
|
|
|
bool initialized = false;
|
2019-02-22 17:45:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|