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

virtual ~IDataType();
    
    
    
    
    
    
    String getName() const;
    
    virtual const char * getFamilyName() const = 0;
    
    virtual TypeIndex getTypeId() const = 0;
    static constexpr auto MAIN_SUBCOLUMN_NAME = "__main";
    virtual DataTypePtr tryGetSubcolumnType(const String & subcolumn_name) const;
    DataTypePtr getSubcolumnType(const String & subcolumn_name) const;
    virtual ColumnPtr getSubcolumn(const String & subcolumn_name, const IColumn & column) const;
    Names getSubcolumnNames() const;
    
    SerializationPtr getDefaultSerialization() const;
    
    
    
    
    using StreamExistenceCallback = std::function<bool(const String &)>;
    using BaseSerializationGetter = std::function<SerializationPtr(const IDataType &)>;
    
    
    static SerializationPtr getSerialization(