**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

{
        const auto & column = arguments.back().column;
        if (!column)
            throw Exception("Second argument to " + getName() + " must be a constant string describing type."
                " Instead there is non-constant column of type " + arguments.back().type->getName(),
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
        const auto * type_col = checkAndGetColumnConst<ColumnString>(column.get());
        if (!type_col)
            throw Exception("Second argument to " + getName() + " must be a constant string describing type."
                " Instead there is a column with the following structure: " + column->dumpStructure(),
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
        DataTypePtr type = DataTypeFactory::instance().get(type_col->getValue<String>());
        if constexpr (cast_type == CastType::accurateOrNull)
        {
            return makeNullable(type);
        }
        else
        {
            if (keep_nullable && arguments.front().type->isNullable())
                return makeNullable(type);
            return type;
        }
    }
    bool useDefaultImplementationForNulls() const override { return false; }