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

Function createContextForSubQuery

src/Interpreters/executeSubQuery.cpp:19–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19ContextMutablePtr createContextForSubQuery(ContextPtr context, String sub_query_tag)
20{
21 auto query_context = Context::createCopy(context);
22 query_context->makeSessionContext();
23 query_context->makeQueryContext();
24
25 auto parent_initial_query_id = context->getInitialQueryId();
26 auto uuid = UUIDHelpers::UUIDToString(UUIDHelpers::generateV4());
27 String initial_query_id;
28 if (sub_query_tag.empty())
29 initial_query_id = fmt::format("{}_{}", context->getCurrentQueryId(), uuid);
30 else
31 initial_query_id = fmt::format("{}_{}_{}", context->getCurrentQueryId(), sub_query_tag, uuid);
32
33 query_context->getClientInfo().parent_initial_query_id = parent_initial_query_id;
34 query_context->getClientInfo().initial_query_id = initial_query_id;
35 query_context->setCurrentQueryId(initial_query_id);
36
37 return query_context;
38}
39
40void modifyQueryContext(ContextMutablePtr query_context, bool internal)
41{

Callers 6

createQueryContextMethod · 0.85
fillTableIfNeededMethod · 0.85
Analysis.cppFile · 0.85
getInSubqueryResultMethod · 0.85
executeImplMethod · 0.85

Calls 8

UUIDToStringFunction · 0.85
generateV4Function · 0.85
makeSessionContextMethod · 0.80
getInitialQueryIdMethod · 0.80
getCurrentQueryIdMethod · 0.80
setCurrentQueryIdMethod · 0.80
makeQueryContextMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected