MCPcopy Create free account
hub / github.com/apache/arrow / AggregatesToString

Function AggregatesToString

cpp/src/arrow/acero/aggregate_internal.cc:155–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void AggregatesToString(std::stringstream* ss, const Schema& input_schema,
156 const std::vector<Aggregate>& aggs,
157 const std::vector<std::vector<int>>& target_fieldsets,
158 int indent) {
159 *ss << "aggregates=[" << std::endl;
160 for (size_t i = 0; i < aggs.size(); i++) {
161 for (int j = 0; j < indent; ++j) *ss << " ";
162 *ss << '\t' << aggs[i].function << '(';
163 const auto& target = target_fieldsets[i];
164 if (target.size() == 0) {
165 *ss << "*";
166 } else {
167 *ss << input_schema.field(target[0])->name();
168 for (size_t k = 1; k < target.size(); k++) {
169 *ss << ", " << input_schema.field(target[k])->name();
170 }
171 }
172 if (aggs[i].options) {
173 *ss << ", " << aggs[i].options->ToString();
174 }
175 *ss << ")," << std::endl;
176 }
177 for (int j = 0; j < indent; ++j) *ss << " ";
178 *ss << ']';
179}
180
181Status ExtractSegmenterValues(std::vector<Datum>* values_ptr,
182 const ExecBatch& input_batch,

Callers 2

ToStringExtraMethod · 0.85
ToStringExtraMethod · 0.85

Calls 4

sizeMethod · 0.45
nameMethod · 0.45
fieldMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected