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

Function bytes_ptr_eq

arrow-select/src/dictionary.rs:155–167  ·  view source on GitHub ↗

Performs a cheap, pointer-based comparison of two byte array See [`ScalarBuffer::ptr_eq`]

(a: &dyn Array, b: &dyn Array)

Source from the content-addressed store, hash-verified

153///
154/// See [`ScalarBuffer::ptr_eq`]
155fn bytes_ptr_eq<T: ByteArrayType>(a: &dyn Array, b: &dyn Array) -> bool {
156 match (a.as_bytes_opt::<T>(), b.as_bytes_opt::<T>()) {
157 (Some(a), Some(b)) => {
158 let values_eq = a.values().ptr_eq(b.values()) && a.offsets().ptr_eq(b.offsets());
159 match (a.nulls(), b.nulls()) {
160 (Some(a), Some(b)) => values_eq && a.inner().ptr_eq(b.inner()),
161 (None, None) => values_eq,
162 _ => false,
163 }
164 }
165 _ => false,
166 }
167}
168
169/// A type-erased function that compares two array for pointer equality
170type PtrEq = fn(&dyn Array, &dyn Array) -> bool;

Callers

nothing calls this directly

Calls 5

ptr_eqMethod · 0.45
valuesMethod · 0.45
offsetsMethod · 0.45
nullsMethod · 0.45
innerMethod · 0.45

Tested by

no test coverage detected