mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added more comments to AggregatingTransform.
This commit is contained in:
parent
41baae33d4
commit
95916e39cf
@ -413,6 +413,9 @@ AggregatingTransform::~AggregatingTransform() = default;
|
||||
|
||||
IProcessor::Status AggregatingTransform::prepare()
|
||||
{
|
||||
/// There are one or two input ports.
|
||||
/// The first one is used at aggregation step, the second one - while reading merged data from ConvertingAggregated
|
||||
|
||||
auto & output = outputs.front();
|
||||
/// Last output is current. All other outputs should already be closed.
|
||||
auto & input = inputs.back();
|
||||
|
@ -49,6 +49,21 @@ struct ManyAggregatedData
|
||||
using AggregatingTransformParamsPtr = std::shared_ptr<AggregatingTransformParams>;
|
||||
using ManyAggregatedDataPtr = std::shared_ptr<ManyAggregatedData>;
|
||||
|
||||
/** Aggregates the stream of blocks using the specified key columns and aggregate functions.
|
||||
* Columns with aggregate functions adds to the end of the block.
|
||||
* If final = false, the aggregate functions are not finalized, that is, they are not replaced by their value, but contain an intermediate state of calculations.
|
||||
* This is necessary so that aggregation can continue (for example, by combining streams of partially aggregated data).
|
||||
*
|
||||
* For every separate stream of data separate AggregatingTransform is created.
|
||||
* Every AggregatingTransform reads data from the first port till is is not run out, or max_rows_to_group_by reached.
|
||||
* When the last AggregatingTransform finish reading, the result of aggregation is needed to be merged together.
|
||||
* This task is performed by ConvertingAggregatedToChunksTransform.
|
||||
* Last AggregatingTransform expands pipeline and adds second input port, which reads from ConvertingAggregated.
|
||||
*
|
||||
* Aggregation data is passed by ManyAggregatedData structure, which is shared between all aggregating transforms.
|
||||
* At aggregation step, every transform uses it's own AggregatedDataVariants structure.
|
||||
* At merging step, all structures pass to ConvertingAggregatedToChunksTransform.
|
||||
*/
|
||||
class AggregatingTransform : public IProcessor
|
||||
{
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user