MCPcopy Create free account
hub / github.com/apache/arrow-rs / build_string_float_array

Function build_string_float_array

arrow/benches/cast_kernels.rs:130–146  ·  view source on GitHub ↗
(size: usize, null_density: f32)

Source from the content-addressed store, hash-verified

128}
129
130fn build_string_float_array(size: usize, null_density: f32) -> ArrayRef {
131 let mut builder = StringBuilder::new();
132
133 let mut rng = seedable_rng();
134
135 for _ in 0..size {
136 if rng.random::<f32>() < null_density {
137 builder.append_null()
138 } else {
139 builder.append_value(
140 rng.random_range(-999_999_999f32..999_999_999f32)
141 .to_string(),
142 )
143 }
144 }
145 Arc::new(builder.finish())
146}
147
148fn build_float64_array_for_cast_to_decimal(size: usize, null_density: f32) -> ArrayRef {
149 Arc::new(create_primitive_array_range::<Float64Type>(

Callers 1

add_benchmarkFunction · 0.85

Calls 4

seedable_rngFunction · 0.50
append_nullMethod · 0.45
append_valueMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected