MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / extractColumn

Method extractColumn

src/DataTypes/NestedUtils.cpp:637–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635{}
636
637std::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
660std::optional<ColumnWithTypeAndName> NestedColumnExtractHelper::extractColumn(
661 const String & original_column_name, const String & column_name_prefix, const String & column_name_suffix)

Callers 3

readMethod · 0.80
orcColumnsToCHChunkMethod · 0.80
arrowColumnsToCHChunkMethod · 0.80

Calls 10

flattenFunction · 0.85
concatenateNameFunction · 0.85
getByNameMethod · 0.80
splitNameFunction · 0.70
hasMethod · 0.45
containsMethod · 0.45
findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
findByNameMethod · 0.45

Tested by

no test coverage detected