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

Function create_unicode_string_array

datafusion/functions/benches/pad.rs:50–64  ·  view source on GitHub ↗
(
    size: usize,
    null_density: f32,
)

Source from the content-addressed store, hash-verified

48];
49
50fn create_unicode_string_array<O: OffsetSizeTrait>(
51 size: usize,
52 null_density: f32,
53) -> arrow::array::GenericStringArray<O> {
54 let mut rng = rand::rng();
55 let mut builder = GenericStringBuilder::<O>::new();
56 for i in 0..size {
57 if rng.random::<f32>() < null_density {
58 builder.append_null();
59 } else {
60 builder.append_value(UNICODE_STRINGS[i % UNICODE_STRINGS.len()]);
61 }
62 }
63 builder.finish()
64}
65
66fn create_unicode_string_view_array(
67 size: usize,

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
append_nullMethod · 0.45
append_valueMethod · 0.45
lenMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…