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

Function generate_string_array

datafusion/functions-nested/src/string.rs:565–588  ·  view source on GitHub ↗
(
    list_arr: &GenericListArray<O>,
    delimiters: &[Option<&str>],
    null_strings: &[Option<&str>],
)

Source from the content-addressed store, hash-verified

563}
564
565fn generate_string_array<O: OffsetSizeTrait>(
566 list_arr: &GenericListArray<O>,
567 delimiters: &[Option<&str>],
568 null_strings: &[Option<&str>],
569) -> Result<StringArray> {
570 let mut builder = StringBuilder::with_capacity(list_arr.len(), 0);
571
572 for ((arr, &delimiter), &null_string) in list_arr
573 .iter()
574 .zip(delimiters.iter())
575 .zip(null_strings.iter())
576 {
577 let (Some(arr), Some(delimiter)) = (arr, delimiter) else {
578 builder.append_null();
579 continue;
580 };
581
582 let mut first = true;
583 compute_array_to_string(&mut builder, &arr, delimiter, null_string, &mut first)?;
584 builder.append_value("");
585 }
586
587 Ok(builder.finish())
588}
589
590fn compute_array_to_string(
591 w: &mut impl Write,

Callers

nothing calls this directly

Calls 6

compute_array_to_stringFunction · 0.85
lenMethod · 0.45
iterMethod · 0.45
append_nullMethod · 0.45
append_valueMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…