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

Function general_array_distance

datafusion/functions-nested/src/distance.rs:148–159  ·  view source on GitHub ↗
(arrays: &[ArrayRef])

Source from the content-addressed store, hash-verified

146}
147
148fn general_array_distance<O: OffsetSizeTrait>(arrays: &[ArrayRef]) -> Result<ArrayRef> {
149 let list_array1 = as_generic_list_array::<O>(&arrays[0])?;
150 let list_array2 = as_generic_list_array::<O>(&arrays[1])?;
151
152 let result = list_array1
153 .iter()
154 .zip(list_array2.iter())
155 .map(|(arr1, arr2)| compute_array_distance(arr1, arr2))
156 .collect::<Result<Float64Array>>()?;
157
158 Ok(Arc::new(result) as ArrayRef)
159}
160
161/// Computes the Euclidean distance between two arrays
162fn compute_array_distance(

Callers

nothing calls this directly

Calls 4

compute_array_distanceFunction · 0.85
newFunction · 0.85
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…