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

Function ExtractValues

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

Source from the content-addressed store, hash-verified

225}
226
227Result<std::vector<Datum>> ExtractValues(const ExecBatch& input_batch,
228 const std::vector<int>& field_ids) {
229 DCHECK_GT(input_batch.length, 0);
230 std::vector<Datum> values;
231 int64_t row = input_batch.length - 1;
232 values.clear();
233 values.resize(field_ids.size());
234 for (size_t i = 0; i < field_ids.size(); i++) {
235 const Datum& value = input_batch.values[field_ids[i]];
236 if (value.is_scalar()) {
237 values[i] = value;
238 } else if (value.is_array()) {
239 ARROW_ASSIGN_OR_RAISE(auto scalar, value.make_array()->GetScalar(row));
240 values[i] = scalar;
241 } else {
242 DCHECK(false);
243 }
244 }
245 return values;
246}
247
248} // namespace aggregate
249

Callers

nothing calls this directly

Calls 5

resizeMethod · 0.80
is_scalarMethod · 0.80
is_arrayMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected