MCPcopy Create free account
hub / github.com/ByConity/ByConity / prefetchForMapColumn

Method prefetchForMapColumn

src/Storages/MergeTree/IMergeTreeReader.cpp:432–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432void IMergeTreeReader::prefetchForMapColumn(
433 Priority priority,
434 const NameAndTypePair & name_and_type,
435 size_t from_mark,
436 bool continue_reading,
437 size_t current_task_last_mark)
438{
439 const auto & [name, type] = name_and_type;
440 // collect all the substreams based on map column's name and its keys substream.
441 // and somehow construct runtime two implicit columns(key&value) representation.
442 auto keys_iter = map_column_keys.equal_range(name);
443 const DataTypeMap & type_map = typeid_cast<const DataTypeMap &>(*type);
444 DataTypePtr impl_value_type = type_map.getValueTypeForImplicitColumn();
445
446 for (auto kit = keys_iter.first; kit != keys_iter.second; ++kit)
447 {
448 String impl_key_name = getImplicitColNameForMapKey(name, kit->second);
449 NameAndTypePair implicit_key_name_and_type{impl_key_name, impl_value_type};
450 auto cache = caches[implicit_key_name_and_type.getNameInStorage()];
451
452 // If MAP implicit column and MAP column co-exist in columns, implicit column should
453 // only read only once.
454 if (dup_implicit_keys.count(impl_key_name) != 0)
455 continue;
456
457 const SerializationPtr & serialization = serializations[impl_key_name];
458 prefetchForColumn(priority, implicit_key_name_and_type, serialization, from_mark,
459 continue_reading, current_task_last_mark, cache);
460 }
461}
462
463void IMergeTreeReader::prefetchForColumn(
464 Priority priority,

Callers

nothing calls this directly

Calls 4

getNameInStorageMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected