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

Method fillData

src/Storages/System/StorageSystemQueryConditionCache.cpp:36–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void StorageSystemQueryConditionCache::fillData(MutableColumns & res_columns, ContextPtr context, const ActionsDAG::Node *, std::vector<UInt8>) const
37{
38 QueryConditionCachePtr query_condition_cache = context->getQueryConditionCache();
39
40 if (!query_condition_cache)
41 return;
42
43 std::vector<QueryConditionCache::Cache::KeyMapped> content = query_condition_cache->dump();
44
45 auto to_string = [](const auto & values)
46 {
47 String str;
48 for (auto val : values)
49 str += std::to_string(val);
50 return str;
51 };
52
53 for (const auto & [key, entry] : content)
54 {
55 ssize_t i = -1;
56 res_columns[++i]->insert(key);
57#if defined(DEBUG_OR_SANITIZER_BUILD)
58 res_columns[++i]->insert(entry->table_id);
59 res_columns[++i]->insert(entry->part_name);
60 res_columns[++i]->insert(entry->condition);
61 res_columns[++i]->insert(entry->condition_hash);
62#endif
63 res_columns[++i]->insert(QueryConditionCache::EntryWeight()(*entry));
64
65 std::shared_lock lock(entry->mutex);
66 res_columns[++i]->insert(to_string(entry->matching_marks));
67 }
68}
69
70}

Callers

nothing calls this directly

Calls 5

to_stringFunction · 0.50
EntryWeightClass · 0.50
dumpMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected