| 635 | {} |
| 636 | |
| 637 | std::optional<ColumnWithTypeAndName> NestedColumnExtractHelper::extractColumn(const String & column_name) |
| 638 | { |
| 639 | if (block.has(column_name, case_insentive)) |
| 640 | return {block.getByName(column_name, case_insentive)}; |
| 641 | |
| 642 | auto nested_names = Nested::splitName(column_name); |
| 643 | if (case_insentive) |
| 644 | { |
| 645 | boost::to_lower(nested_names.first); |
| 646 | boost::to_lower(nested_names.second); |
| 647 | } |
| 648 | if (!block.has(nested_names.first, case_insentive)) |
| 649 | return {}; |
| 650 | |
| 651 | if (!nested_tables.contains(nested_names.first)) |
| 652 | { |
| 653 | ColumnsWithTypeAndName columns = {block.getByName(nested_names.first, case_insentive)}; |
| 654 | nested_tables[nested_names.first] = std::make_shared<Block>(Nested::flatten(columns)); |
| 655 | } |
| 656 | |
| 657 | return extractColumn(column_name, nested_names.first, nested_names.second); |
| 658 | } |
| 659 | |
| 660 | std::optional<ColumnWithTypeAndName> NestedColumnExtractHelper::extractColumn( |
| 661 | const String & original_column_name, const String & column_name_prefix, const String & column_name_suffix) |
no test coverage detected