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

Method createAttributes

src/Dictionaries/HashedArrayDictionary.cpp:450–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448
449template <DictionaryKeyType dictionary_key_type, bool sharded>
450void HashedArrayDictionary<dictionary_key_type, sharded>::createAttributes()
451{
452 const auto size = dict_struct.attributes.size();
453 attributes.reserve(size);
454
455 for (const auto & dictionary_attribute : dict_struct.attributes)
456 {
457 auto type_call = [&, this](const auto & dictionary_attribute_type)
458 {
459 using Type = std::decay_t<decltype(dictionary_attribute_type)>;
460 using AttributeType = typename Type::AttributeType;
461 using ValueType = DictionaryValueType<AttributeType>;
462
463 auto is_index_null = dictionary_attribute.is_nullable ? std::make_optional<VectorWithMemoryTracking<typename Attribute::RowsMask>>(configuration.shards) : std::nullopt;
464 Attribute attribute{
465 .containers = AttributeContainerShardsType<ValueType>(configuration.shards),
466 .is_index_null = std::move(is_index_null),
467 .type = dictionary_attribute.underlying_type};
468 attributes.emplace_back(std::move(attribute));
469 };
470
471 callOnDictionaryAttributeType(dictionary_attribute.underlying_type, type_call);
472 }
473
474 key_attribute.containers.resize(configuration.shards);
475 element_counts.resize(configuration.shards);
476
477 string_arenas.resize(configuration.shards);
478 for (auto & arena : string_arenas)
479 arena = std::make_unique<Arena>();
480}
481
482template <DictionaryKeyType dictionary_key_type, bool sharded>
483void HashedArrayDictionary<dictionary_key_type, sharded>::updateData()

Callers

nothing calls this directly

Calls 5

sizeMethod · 0.45
reserveMethod · 0.45
emplace_backMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected