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

Function assertFragmentSerializable

src/Processors/QueryPlan/QueryPlan.cpp:55–71  ·  view source on GitHub ↗

A stage fragment is shipped to workers by serializing its query plan, so every step must support serialization. Check up front (without serializing) so an unsupported plan fails early with a clear message instead of late, mid-execution, with a generic error.

Source from the content-addressed store, hash-verified

53/// serialization. Check up front (without serializing) so an unsupported plan fails early with a clear
54/// message instead of late, mid-execution, with a generic error.
55void assertFragmentSerializable(const QueryPlan & fragment, const String & stage_name)
56{
57 std::vector<const QueryPlan::Node *> stack;
58 if (fragment.getRootNode())
59 stack.push_back(fragment.getRootNode());
60 while (!stack.empty())
61 {
62 const auto * node = stack.back();
63 stack.pop_back();
64 if (node->step && !node->step->isSerializable())
65 throw Exception(ErrorCodes::SUPPORT_IS_DISABLED,
66 "make_distributed_plan cannot distribute this query: step '{}' in stage '{}' is not "
67 "serializable for remote execution", node->step->getName(), stage_name);
68 for (const auto * child : node->children)
69 stack.push_back(child);
70 }
71}
72
73}
74

Callers 1

convertToDistributedMethod · 0.85

Calls 8

getRootNodeMethod · 0.80
ExceptionClass · 0.50
push_backMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45
isSerializableMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected