mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 10:22:10 +00:00
29 lines
731 B
C++
29 lines
731 B
C++
#pragma once
|
|
#include <Processors/IInflatingTransform.h>
|
|
#include <Processors/Transforms/AggregatingTransform.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Takes blocks after grouping, with non-finalized aggregate functions.
|
|
/// Calculates subtotals and grand totals values for a set of columns.
|
|
class RollupTransform : public IInflatingTransform
|
|
{
|
|
public:
|
|
RollupTransform(Block header, AggregatingTransformParamsPtr params);
|
|
String getName() const override { return "RollupTransform"; }
|
|
|
|
protected:
|
|
void consume(Chunk chunk) override;
|
|
bool canGenerate() override;
|
|
Chunk generate() override;
|
|
|
|
private:
|
|
AggregatingTransformParamsPtr params;
|
|
ColumnNumbers keys;
|
|
Chunk consumed_chunk;
|
|
size_t last_removed_key = 0;
|
|
};
|
|
|
|
}
|