2018-08-21 16:08:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DataStreams/IProfilingBlockInputStream.h>
|
|
|
|
#include <Common/Arena.h>
|
|
|
|
#include <Interpreters/Aggregator.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ExpressionActions;
|
|
|
|
|
|
|
|
|
|
|
|
/** Takes blocks after grouping, with non-finalized aggregate functions.
|
2018-08-27 09:09:47 +00:00
|
|
|
* Calculates subtotals and grand totals values for a set of columns.
|
2018-08-21 16:08:45 +00:00
|
|
|
*/
|
|
|
|
class RollupBlockInputStream : public IProfilingBlockInputStream
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
using ExpressionActionsPtr = std::shared_ptr<ExpressionActions>;
|
|
|
|
using AggregateColumns = std::vector<ColumnRawPtrs>;
|
|
|
|
public:
|
|
|
|
RollupBlockInputStream(
|
|
|
|
const BlockInputStreamPtr & input_, const Aggregator::Params & params_);
|
|
|
|
|
|
|
|
String getName() const override { return "Rollup"; }
|
|
|
|
|
|
|
|
Block getHeader() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Block readImpl() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Aggregator::Params params;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|