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

Method printAttributes

src/QueryPlan/PlanPrinter.cpp:684–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682}
683
684String PlanPrinter::TextPrinter::printAttributes(PlanNodeBase & plan, const TextPrinterIntent & intent, const StepProfiles & profiles) const
685{
686 size_t step_id = plan.getId();
687 if (!profiles.contains(step_id) || profiles.at(step_id)->address_to_attributes.empty())
688 return "";
689 if (!settings.query_plan_options.indexes && !settings.selected_parts)
690 return "";
691 std::stringstream out;
692 const auto & address_to_attributes = profiles.at(step_id)->address_to_attributes;
693 if (plan.getStep()->getType() == IQueryPlanStep::Type::TableScan)
694 {
695 String space;
696 for (const auto & [address, attribute] : address_to_attributes)
697 {
698 if (address_to_attributes.size() > 1)
699 {
700 out << intent.detailIntent() << address;
701 space = " ";
702 }
703 if (settings.query_plan_options.indexes && attribute.contains("Indexes"))
704 {
705 out << intent.detailIntent() << space << "Indexes:";
706 auto index_desc = attribute.at("Indexes");
707 for (const auto & desc : index_desc->name_and_detail)
708 out << intent.detailIntent() << space << " " << desc.second;
709 }
710 if (settings.selected_parts)
711 {
712 if (attribute.contains("SelectParts"))
713 out << intent.detailIntent() << space << attribute.at("SelectParts")->description;
714 if (attribute.contains("TableScanDescription"))
715 out << intent.detailIntent() << space << attribute.at("TableScanDescription")->description;
716 }
717 }
718 return out.str();
719 }
720 return "";
721}
722
723String PlanPrinter::TextPrinter::prettyNum(size_t num, bool pretty_num)
724{

Callers

nothing calls this directly

Calls 9

getStepMethod · 0.80
detailIntentMethod · 0.80
getIdMethod · 0.45
containsMethod · 0.45
emptyMethod · 0.45
atMethod · 0.45
getTypeMethod · 0.45
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected