#pragma once #include namespace DB { class ExpressionActions; using ExpressionActionsPtr = std::shared_ptr; class ExpressionTransform : public ISimpleTransform { public: ExpressionTransform( const Block & header_, ExpressionActionsPtr expression_, bool on_totals_ = false, bool default_totals_ = false); String getName() const override { return "ExpressionTransform"; } protected: void transform(Chunk & chunk) override; private: ExpressionActionsPtr expression; bool on_totals; /// 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. bool default_totals; bool initialized = false; }; }