Clickhouse Server version: 22.3.2.1 and 21.6.5.37

Minimal Reproducible Code: 
`select
	arrayJoin(arrayDifference(groupArray(nb))) as res
from
	(
select
		toUInt32(number % 11) as nb
	from
		numbers(100))`

When I using arrayDifference function on an array of UInt32 elements, I get huge numbers around 2^32 instead of expected negative numbers.   
The same function works properly on Uint8, Uint16 and even Uint64.

And also I found 
> `The type of elements in the resulting array is determined by the type inference rules for subtraction (e.g. UInt8 - UInt8 = Int16).`

in document at [https://clickhouse.com/docs/en/sql-reference/functions/array-functions/#arraydifference](url)

So it seems like an unexpected result, but I'm not sure. Hoping for your anwser! 
{
        
        Element prev{};
        for (size_t pos = begin; pos < end; ++pos)
        {
            if (pos == begin)
            {
                dst[pos] = {};
                prev = src[pos];
            }
            else
            {
                Element curr = src[pos];
                if constexpr (is_decimal<Element>)
                {
                    using ResultNativeType = typename Result::NativeType;
                    ResultNativeType result_value;
                    bool overflow = common::subOverflow(
                        static_cast<ResultNativeType>(curr.value),
                        static_cast<ResultNativeType>(prev.value),
                        result_value);
                    if (overflow)
                        throw Exception(ErrorCodes::DECIMAL_OVERFLOW, "Decimal math overflow");
                    dst[pos] = Result(result_value);
                }
                else
                {
                    dst[pos] = curr - prev;
                }
                prev = curr;