MCPcopy Create free account
hub / github.com/apache/datafusion / append_batch

Method append_batch

datafusion/functions-aggregate/src/string_agg.rs:344–366  ·  view source on GitHub ↗
(
        &mut self,
        iter: impl Iterator<Item = Option<&'a str>>,
        group_indices: &[usize],
    )

Source from the content-addressed store, hash-verified

342 }
343
344 fn append_batch<'a>(
345 &mut self,
346 iter: impl Iterator<Item = Option<&'a str>>,
347 group_indices: &[usize],
348 ) {
349 for (opt_value, &group_idx) in iter.zip(group_indices.iter()) {
350 if let Some(value) = opt_value {
351 match &mut self.values[group_idx] {
352 Some(existing) => {
353 let added = self.delimiter.len() + value.len();
354 existing.reserve(added);
355 existing.push_str(&self.delimiter);
356 existing.push_str(value);
357 self.total_data_bytes += added;
358 }
359 slot @ None => {
360 *slot = Some(value.to_string());
361 self.total_data_bytes += value.len();
362 }
363 }
364 }
365 }
366 }
367}
368
369impl GroupsAccumulator for StringAggGroupsAccumulator {

Callers 1

update_batchMethod · 0.45

Calls 4

reserveMethod · 0.80
iterMethod · 0.45
lenMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected