mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
42 lines
922 B
C++
42 lines
922 B
C++
#pragma once
|
|
|
|
#include <DataStreams/IBlockInputStream.h>
|
|
#include <Interpreters/Aggregator.h>
|
|
#include <Core/ColumnNumbers.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ExpressionActions;
|
|
|
|
|
|
/** Takes blocks after grouping, with non-finalized aggregate functions.
|
|
* Calculates subtotals and grand totals values for a set of columns.
|
|
*/
|
|
class RollupBlockInputStream : public IBlockInputStream
|
|
{
|
|
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 aggregator;
|
|
ColumnNumbers keys;
|
|
ssize_t current_key = -1;
|
|
Block rollup_block;
|
|
bool is_data_read = false;
|
|
};
|
|
|
|
}
|