**Describe the bug**
```
SELECT number % 100 AS k, sumArray(emptyArrayUInt8()) AS v FROM numbers(10) GROUP BY k
```
Fails under ASan.

if (false) {} 
                    APPLY_FOR_VARIANTS_TWO_LEVEL(M)
            #undef M
                else
                    throw Exception("Unknown aggregated data variant.", ErrorCodes::UNKNOWN_AGGREGATED_DATA_VARIANT);
            }
        };
        std::unique_ptr<ThreadPool> thread_pool;
        if (max_threads > 1 && total_input_rows > 100000)    
            thread_pool = std::make_unique<ThreadPool>(max_threads);
        for (const auto & bucket_blocks : bucket_to_blocks)
        {
            const auto bucket = bucket_blocks.first;
            if (bucket == -1)
                continue;
            result.aggregates_pools.push_back(std::make_shared<Arena>());
            Arena * aggregates_pool = result.aggregates_pools.back().get();
            auto task = [group = CurrentThread::getGroup(), bucket, &merge_bucket, aggregates_pool]{ return merge_bucket(bucket, aggregates_pool, group); };
            if (thread_pool)
                thread_pool->scheduleOrThrowOnError(task);
            else
                task();
        }
        if (thread_pool)
            thread_pool->wait();
        LOG_TRACE(log, "Merged partially aggregated two-level data.");
    }
    if (isCancelled())
    {
        result.invalidate();