**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 this data type cannot be wrapped in Nullable data type.
      */
    virtual bool canBeInsideNullable() const { return false; }
    virtual bool lowCardinality() const { return false; }
    
    virtual bool canBeInsideLowCardinality() const { return false; }
    
    static void updateAvgValueSizeHint(const IColumn & column, double & avg_value_size_hint);
protected:
    friend class DataTypeFactory;
    friend class AggregateFunctionSimpleState;
    
    void setCustomization(DataTypeCustomDescPtr custom_desc_) const;
    
    mutable DataTypeCustomNamePtr custom_name;
    mutable SerializationPtr custom_serialization;
public:
    const IDataTypeCustomName * getCustomName() const { return custom_name.get(); }
    const ISerialization * getCustomSerialization() const { return custom_serialization.get(); }
};
struct WhichDataType
{
    TypeIndex idx;
    constexpr WhichDataType(TypeIndex idx_ = TypeIndex::Nothing) : idx(idx_) {}
    constexpr WhichDataType(const IDataType & data_type) : idx(data_type.getTypeId()) {}
    constexpr WhichDataType(const IDataType * data_type) : idx(data_type->getTypeId()) {}
    
    WhichDataType(const DataTypePtr & data_type) : idx(data_type->getTypeId()) {}