Found in stress test: https://gist.github.com/alesapin/5cd6b8901488a1f170d5ef389900a534
Report: https://s3.amazonaws.com/clickhouse-test-reports/31158/7fb9a42b119b6c3eba1784caaabde51c1ded3384/stress_tests__debug__actions_.html
Pipe & pipe,
    AggregatingTransformParamsPtr params,
    size_t num_merging_processors)
{
    pipe.addTransform(std::make_shared<GroupingAggregatedTransform>(pipe.getHeader(), pipe.numOutputPorts(), params));
    if (num_merging_processors <= 1)
    {
        
        pipe.addTransform(std::make_shared<MergingAggregatedBucketTransform>(params));
        return;
    }
    
    
    
    pipe.resize(num_merging_processors);
    pipe.addSimpleTransform([params](const Block &)
    {
        return std::make_shared<MergingAggregatedBucketTransform>(params);
    });
    pipe.addTransform(std::make_shared<SortingAggregatedTransform>(num_merging_processors, params));
}
}