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

{
        ColumnArray & arr_to = assert_cast<ColumnArray &>(to);
        ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
        const typename State::Set & set = this->data(place).value;
        size_t size = set.size();
        offsets_to.push_back(offsets_to.back() + size);
        typename ColumnVector<T>::Container & data_to = assert_cast<ColumnVector<T> &>(arr_to.getData()).getData();
        size_t old_size = data_to.size();
        data_to.resize(old_size + size);
        size_t i = 0;
        for (auto it = set.begin(); it != set.end(); ++it, ++i)
            data_to[old_size + i] = it->getValue();
    }
};
struct AggregateFunctionGroupUniqArrayGenericData
{
    static constexpr size_t INITIAL_SIZE_DEGREE = 3; 
    using Set = HashSetWithSavedHashWithStackMemory<StringRef, StringRefHash,
        INITIAL_SIZE_DEGREE>;
    Set value;
};
template <bool is_plain_column>
static void deserializeAndInsertImpl(StringRef str, IColumn & data_to);
/** Template parameter with true value should be used for columns that store their elements in memory continuously.
 *  For such columns groupUniqArray() can be implemented more efficiently (especially for small numeric arrays).
 */
template <bool is_plain_column = false, typename Tlimit_num_elem = std::false_type>
class AggregateFunctionGroupUniqArrayGeneric