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

Function buildCursorTree

src/Core/Streaming/CursorTree.cpp:168–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168CursorTreeNodePtr buildCursorTree(const Map & collapsed_tree)
169{
170 CursorTreeNodePtr root = std::make_shared<CursorTreeNode>();
171
172 for (const auto & leaf : collapsed_tree)
173 {
174 const auto & tuple = leaf.safeGet<Tuple>();
175 const auto & dotted_path = tuple.at(0).safeGet<String>();
176 const auto & value = tuple.at(1).safeGet<Int64>();
177
178 std::vector<String> path;
179 boost::split(path, dotted_path, boost::is_any_of("."));
180
181 CursorTreeNode * node = root.get();
182 for (size_t i = 0; i + 1 < path.size(); ++i)
183 node = node->getSubtreeOrCreate(path[i]).get();
184
185 node->setValue(path.back(), value);
186 }
187
188 return root;
189}
190
191}

Callers 4

formatImplMethod · 0.85
TESTFunction · 0.85
buildJoinTreeMethod · 0.85
TESTFunction · 0.85

Calls 6

splitFunction · 0.50
atMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45
setValueMethod · 0.45
backMethod · 0.45

Tested by 2

TESTFunction · 0.68
TESTFunction · 0.68