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

Function formatOutputColumns

src/Processors/QueryPlan/QueryPlanFormat.cpp:126–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 }
125
126 void formatOutputColumns(const std::unordered_map<String, PrettyColumnName> & pretty_names, WriteBuffer & out, const IQueryPlanStep & step, const String & prefix)
127 {
128 if (!step.hasOutputHeader() || step.getOutputHeader()->empty())
129 {
130 out << prefix << "Output: Empty\n";
131 return;
132 }
133
134 out << prefix << "Output: ";
135 bool first = true;
136 for (const auto & elem : *step.getOutputHeader())
137 {
138 if (!first)
139 out << ", ";
140 first = false;
141 auto it = pretty_names.find(elem.name);
142 String pretty_name = it != pretty_names.end() ? it->second.expression : trimColumnIdentifier(elem.name);
143
144 out << pretty_name;
145 }
146 out << '\n';
147 }
148
149 static PrettyColumnName formatFilterPretty(
150 const ActionsDAG & dag,

Callers 3

describeActionsMethod · 0.85
explainPlanMethod · 0.85
describeActionsMethod · 0.85

Calls 6

trimColumnIdentifierFunction · 0.85
hasOutputHeaderMethod · 0.80
getOutputHeaderMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected