**How to reproduce**
Clickhouse version 20.11.5.18, 20.8.7.15, 20.3.19
```
SELECT
    groupUniqArray(val) AS uniq,
    toTypeName(uniq),
    groupArray(val) AS arr,
    toTypeName(arr)
FROM
(
    SELECT CAST(number % 2, 'Enum(\'hello\' = 1, \'world\' = 0)') AS val
    FROM numbers(2)
)

Query id: d4657f27-c8bd-4174-9947-c6c48d0222d5

┌─uniq──┬─toTypeName(groupUniqArray(val))─┬─arr───────────────┬─toTypeName(groupArray(val))────────────┐
│ [0,1] │ Array(Int8)                     │ ['world','hello'] │ Array(Enum8('world' = 0, 'hello' = 1)) │
└───────┴─────────────────────────────────┴───────────────────┴────────────────────────────────────────┘
```

#pragma once
#include <cassert>
#include <IO/WriteHelpers.h>
#include <IO/ReadHelpers.h>
#include <DataTypes/DataTypeArray.h>
#include <DataTypes/DataTypesNumber.h>
#include <DataTypes/DataTypeString.h>
#include <Columns/ColumnArray.h>
#include <Common/HashTable/HashSet.h>
#include <Common/HashTable/HashTableKeyHolder.h>
#include <Common/assert_cast.h>
#include <AggregateFunctions/IAggregateFunction.h>
#include <AggregateFunctions/KeyHolderHelpers.h>
#define AGGREGATE_FUNCTION_GROUP_ARRAY_UNIQ_MAX_SIZE 0xFFFFFF
namespace DB
{
template <typename T>
struct AggregateFunctionGroupUniqArrayData
{
    
    using Set = HashSetWithStackMemory<T, DefaultHash<T>, 4>;
    Set value;
};
template <typename T, typename Tlimit_num_elem>
class AggregateFunctionGroupUniqArray