**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)) │
└───────┴─────────────────────────────────┴───────────────────┴────────────────────────────────────────┘
```

: public IAggregateFunctionDataHelper<AggregateFunctionGroupUniqArrayData<T>, AggregateFunctionGroupUniqArray<T, Tlimit_num_elem>>
{
    static constexpr bool limit_num_elems = Tlimit_num_elem::value;
    UInt64 max_elems;
private:
    using State = AggregateFunctionGroupUniqArrayData<T>;
public:
    AggregateFunctionGroupUniqArray(const DataTypePtr & argument_type, UInt64 max_elems_ = std::numeric_limits<UInt64>::max())
        : IAggregateFunctionDataHelper<AggregateFunctionGroupUniqArrayData<T>,
          AggregateFunctionGroupUniqArray<T, Tlimit_num_elem>>({argument_type}, {}),
          max_elems(max_elems_) {}
    String getName() const override { return "groupUniqArray"; }
    DataTypePtr getReturnType() const override
    {
        return std::make_shared<DataTypeArray>(std::make_shared<DataTypeNumber<T>>());
    }
    void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override
    {
        if (limit_num_elems && this->data(place).value.size() >= max_elems)
            return;
        this->data(place).value.insert(assert_cast<const ColumnVector<T> &>(*columns[0]).getData()[row_num]);
    }
    void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override