| 158 | } |
| 159 | |
| 160 | NamesAndTypesList convertToSubcolumns(const NamesAndTypesList & names_and_types) |
| 161 | { |
| 162 | auto nested_types = getSubcolumnsOfNested(names_and_types); |
| 163 | auto res = names_and_types; |
| 164 | |
| 165 | for (auto & name_type : res) |
| 166 | { |
| 167 | if (!isArray(name_type.type)) |
| 168 | continue; |
| 169 | |
| 170 | auto split = splitName(name_type.name); |
| 171 | if (name_type.isSubcolumn() || split.second.empty()) |
| 172 | continue; |
| 173 | |
| 174 | auto it = nested_types.find(split.first); |
| 175 | if (it != nested_types.end()) |
| 176 | name_type = NameAndTypePair{split.first, split.second, it->second, it->second->getSubcolumnType(split.second)}; |
| 177 | } |
| 178 | |
| 179 | return res; |
| 180 | } |
| 181 | |
| 182 | |
| 183 | void validateArraySizes(const Block & block) |