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

Method describeDistributedPlan

src/Processors/QueryPlan/ReadFromRemote.cpp:943–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

941}
942
943void ReadFromRemote::describeDistributedPlan(FormatSettings & settings, const ExplainPlanOptions & options)
944{
945 auto header = std::make_shared<const Block>(Block{ColumnWithTypeAndName{ColumnString::create(), std::make_shared<DataTypeString>(), "explain"}});
946 ClusterProxy::SelectStreamFactory::Shards used_shards;
947
948 for (const auto & shard : shards)
949 {
950 if (shard.query_plan)
951 {
952 shard.query_plan->explainPlan(settings.out, options, settings.offset / std::max<size_t>(settings.base_indent, 1) + 1);
953 }
954 else
955 {
956 auto & shard_copy = used_shards.emplace_back(shard);
957 shard_copy.header = header;
958 shard_copy.query = makeExplain(options, shard.query);
959 }
960 }
961
962 formatExplain(settings, addPipes(used_shards, header));
963}
964
965void ReadFromRemote::describeDistributedPipeline(FormatSettings & settings, bool distributed)
966{

Callers 1

explainStepFunction · 0.45

Calls 5

makeExplainFunction · 0.85
formatExplainFunction · 0.85
explainPlanMethod · 0.80
createFunction · 0.50
emplace_backMethod · 0.45

Tested by

no test coverage detected