```
play-eu :) SELECT actor_login, event_type, count() FROM github_events WHERE repo_name = 'ClickHouse/ClickHouse' GROUP BY actor_login, event_type WITH ROLLUP ORDER BY count() DESC LIMIT 10

SELECT
    actor_login,
    event_type,
    count()
FROM github_events
WHERE repo_name = 'ClickHouse/ClickHouse'
GROUP BY
    actor_login,
    event_type
    WITH ROLLUP
ORDER BY count() DESC
LIMIT 10

Query id: 1b7baa06-2ee6-4ae8-b1ed-4c9ecb21514c

Ok.
Exception on client:
Code: 36. DB::Exception: Code: 36. DB::Exception: Unexpected value 0 in enum. (BAD_ARGUMENTS) (version 22.5.1.1984 (official build)). (BAD_ARGUMENTS)
```
/** Two-level aggregation is useful in two cases:
      * 1. Parallel aggregation is done, and the results should be merged in parallel.
      * 2. An aggregation is done with store of temporary data on the disk, and they need to be merged in a memory efficient way.
      */
    auto transform_params = std::make_shared<AggregatingTransformParams>(std::move(params), final);
    if (!grouping_sets_params.empty())
    {
        const size_t grouping_sets_size = grouping_sets_params.size();
        const size_t streams = pipeline.getNumStreams();
        auto input_header = pipeline.getHeader();
        pipeline.transform([&](OutputPortRawPtrs ports)
        {
            Processors copiers;
            copiers.reserve(ports.size());
            for (auto * port : ports)
            {
                auto copier = std::make_shared<CopyTransform>(input_header, grouping_sets_size);
                connect(*port, copier->getInputPort());
                copiers.push_back(copier);
            }
            return copiers;
        });
        pipeline.transform([&](OutputPortRawPtrs ports)
        {
            assert(streams * grouping_sets_size == ports.size());
            Processors processors;
            for (size_t i = 0; i < grouping_sets_size; ++i)
            {
                Aggregator::Params params_for_set
                {