mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
dbms: system.dictionaries: use ext::map for the purpose it was designed for. [#METR-15569]
This commit is contained in:
parent
a369f43e2e
commit
72b2c63557
@ -10,6 +10,7 @@
|
||||
#include <DB/Dictionaries/IDictionary.h>
|
||||
#include <DB/Dictionaries/IDictionarySource.h>
|
||||
#include <DB/Dictionaries/DictionaryStructure.h>
|
||||
#include <statdaemons/ext/map.hpp>
|
||||
#include <mutex>
|
||||
|
||||
namespace DB
|
||||
@ -87,15 +88,12 @@ BlockInputStreams StorageSystemDictionaries::read(
|
||||
col_origin.column->insert(dict_info.second.second);
|
||||
|
||||
const auto & dict_struct = dict_ptr->getStructure();
|
||||
Array attribute_names;
|
||||
Array attribute_types;
|
||||
for (const auto & attribute : dict_struct.attributes)
|
||||
{
|
||||
attribute_names.push_back(attribute.name);
|
||||
attribute_types.push_back(attribute.type->getName());
|
||||
}
|
||||
col_attribute_names.column->insert(attribute_names);
|
||||
col_attribute_types.column->insert(attribute_types);
|
||||
col_attribute_names.column->insert(ext::map<Array>(dict_struct.attributes, [] (auto & attr) -> decltype(auto) {
|
||||
return attr.name;
|
||||
}));
|
||||
col_attribute_types.column->insert(ext::map<Array>(dict_struct.attributes, [] (auto & attr) -> decltype(auto) {
|
||||
return attr.type->getName();
|
||||
}));
|
||||
col_has_hierarchy.column->insert(UInt64{dict_ptr->hasHierarchy()});
|
||||
col_bytes_allocated.column->insert(dict_ptr->getBytesAllocated());
|
||||
col_hit_rate.column->insert(dict_ptr->getHitRate());
|
||||
|
Loading…
Reference in New Issue
Block a user