**Describe the unexpected behaviour**
Expected create view from any "select" query, but it doesn't work.
But select-query is correct and working
version 20.4.5.36
**How to reproduce**

CREATE VIEW tempView AS
WITH(SELECT groupArray(a) FROM (SELECT [1, 2] AS a)) AS aaa
SELECT aaa


**Error message and/or stacktrace**
Code: 53, e.displayText() = DB::Exception: CAST AS Array can only be performed between same-dimensional array types or from String

if (const auto *const type = checkAndGetDataType<DataTypeDate>(to_type))
            return monotonicityForType(type);
        if (const auto *const type = checkAndGetDataType<DataTypeDateTime>(to_type))
            return monotonicityForType(type);
        if (const auto *const type = checkAndGetDataType<DataTypeString>(to_type))
            return monotonicityForType(type);
        if (isEnum(from_type))
        {
            if (const auto *const type = checkAndGetDataType<DataTypeEnum8>(to_type))
                return monotonicityForType(type);
            if (const auto *const type = checkAndGetDataType<DataTypeEnum16>(to_type))
                return monotonicityForType(type);
        }
        
        return {};
    }
};
template<CastType cast_type>
class CastOverloadResolver : public IFunctionOverloadResolverImpl
{
public:
    using MonotonicityForRange = FunctionCast::MonotonicityForRange;
    using Diagnostic = FunctionCast::Diagnostic;
    static constexpr auto accurate_cast_name = "accurateCast";
    static constexpr auto accurate_cast_or_null_name = "accurateCastOrNull";
    static constexpr auto cast_name = "CAST";
    static constexpr auto name = cast_type == CastType::accurate
        ? accurate_cast_name
        : (cast_type == CastType::accurateOrNull ? accurate_cast_or_null_name : cast_name);
    static FunctionOverloadResolverImplPtr create(ContextPtr context)