| 153 | } |
| 154 | |
| 155 | void 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 | |
| 181 | Status ExtractSegmenterValues(std::vector<Datum>* values_ptr, |
| 182 | const ExecBatch& input_batch, |
no test coverage detected