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

Method generate

src/Storages/StorageKeeperMap.cpp:322–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320 std::string getName() const override { return "StorageKeeperMapSource"; }
321
322 Chunk generate() override
323 {
324 auto component_guard = Coordination::setCurrentComponent("StorageKeeperMapSource::generate");
325 if (it >= end)
326 {
327 it = {};
328 return {};
329 }
330
331 using KeyType = typename KeyContainer::value_type;
332 if constexpr (std::same_as<KeyType, Field>)
333 {
334 const auto & sample_block = getPort().getHeader();
335 const auto & key_column_type = sample_block.getByName(storage.getPrimaryKey().at(0)).type;
336 auto raw_keys = serializeKeysToRawString(it, end, key_column_type, max_block_size);
337
338 for (auto & raw_key : raw_keys)
339 raw_key = base64Encode(raw_key, /* url_encoding */ true);
340
341 return storage.getBySerializedKeys(raw_keys, nullptr, with_version_column, getContext());
342 }
343 else
344 {
345 size_t elem_num = std::min(max_block_size, static_cast<size_t>(end - it));
346 auto chunk = storage.getBySerializedKeys(std::span{it, it + elem_num}, nullptr, with_version_column, getContext());
347 it += elem_num;
348 return chunk;
349 }
350 }
351};
352
353StorageKeeperMap::StorageKeeperMap(

Callers

nothing calls this directly

Calls 10

setCurrentComponentFunction · 0.85
serializeKeysToRawStringFunction · 0.85
base64EncodeFunction · 0.85
getByNameMethod · 0.80
getContextFunction · 0.50
minFunction · 0.50
getHeaderMethod · 0.45
atMethod · 0.45
getPrimaryKeyMethod · 0.45
getBySerializedKeysMethod · 0.45

Tested by

no test coverage detected