```
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)
```
{
    if (!consumed_chunks.empty())
    {
        if (consumed_chunks.size() > 1)
            rollup_chunk = merge(std::move(consumed_chunks), false);
        else
            rollup_chunk = std::move(consumed_chunks.front());
        consumed_chunks.clear();
        last_removed_key = keys.size();
    }
    auto gen_chunk = std::move(rollup_chunk);
    if (last_removed_key)
    {
        --last_removed_key;
        auto key = keys[last_removed_key];
        auto num_rows = gen_chunk.getNumRows();
        auto columns = gen_chunk.getColumns();
        columns[key] = columns[key]->cloneEmpty()->cloneResized(num_rows);
        Chunks chunks;
        chunks.emplace_back(std::move(columns), num_rows);
        rollup_chunk = merge(std::move(chunks), false);
    }
    finalizeChunk(gen_chunk, aggregates_mask);
    if (!gen_chunk.empty())
        gen_chunk.addColumn(0, ColumnUInt64::create(gen_chunk.getNumRows(), set_counter++));
    return gen_chunk;
}
}