Performs a cheap, pointer-based comparison of two byte array See [`ScalarBuffer::ptr_eq`]
(a: &dyn Array, b: &dyn Array)
| 153 | /// |
| 154 | /// See [`ScalarBuffer::ptr_eq`] |
| 155 | fn 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 |
| 170 | type PtrEq = fn(&dyn Array, &dyn Array) -> bool; |