| 252 | {} |
| 253 | |
| 254 | std::optional<ColumnWithTypeAndName> NestedColumnExtractHelper::extractColumn(const String & column_name) |
| 255 | { |
| 256 | if (block.has(column_name, case_insentive)) |
| 257 | return {block.getByName(column_name, case_insentive)}; |
| 258 | |
| 259 | auto nested_names = Nested::splitName(column_name); |
| 260 | if (case_insentive) |
| 261 | { |
| 262 | boost::to_lower(nested_names.first); |
| 263 | boost::to_lower(nested_names.second); |
| 264 | } |
| 265 | if (!block.has(nested_names.first, case_insentive)) |
| 266 | return {}; |
| 267 | |
| 268 | if (!nested_tables.contains(nested_names.first)) |
| 269 | { |
| 270 | ColumnsWithTypeAndName columns = {block.getByName(nested_names.first, case_insentive)}; |
| 271 | nested_tables[nested_names.first] = std::make_shared<Block>(Nested::flatten(columns)); |
| 272 | } |
| 273 | |
| 274 | return extractColumn(column_name, nested_names.first, nested_names.second); |
| 275 | } |
| 276 | |
| 277 | std::optional<ColumnWithTypeAndName> NestedColumnExtractHelper::extractColumn( |
| 278 | const String & original_column_name, const String & column_name_prefix, const String & column_name_suffix) |
no test coverage detected