Returns true if this `ArrayData` is equal to `other`, using pointer comparisons to determine buffer equality. This is cheaper than `PartialEq::eq` but may return false when the arrays are logically equal
(&self, other: &Self)
| 1665 | /// to determine buffer equality. This is cheaper than `PartialEq::eq` but may |
| 1666 | /// return false when the arrays are logically equal |
| 1667 | pub fn ptr_eq(&self, other: &Self) -> bool { |
| 1668 | if self.offset != other.offset |
| 1669 | || self.len != other.len |
| 1670 | || self.data_type != other.data_type |
| 1671 | || self.buffers.len() != other.buffers.len() |
| 1672 | || self.child_data.len() != other.child_data.len() |
| 1673 | { |
| 1674 | return false; |
| 1675 | } |
| 1676 | |
| 1677 | match (&self.nulls, &other.nulls) { |
| 1678 | (Some(a), Some(b)) if !a.inner().ptr_eq(b.inner()) => return false, |
| 1679 | (Some(_), None) | (None, Some(_)) => return false, |
| 1680 | _ => {} |
| 1681 | }; |
| 1682 | |
| 1683 | if !self |
| 1684 | .buffers |
| 1685 | .iter() |
| 1686 | .zip(other.buffers.iter()) |
| 1687 | .all(|(a, b)| a.as_ptr() == b.as_ptr()) |
| 1688 | { |
| 1689 | return false; |
| 1690 | } |
| 1691 | |
| 1692 | self.child_data |
| 1693 | .iter() |
| 1694 | .zip(other.child_data.iter()) |
| 1695 | .all(|(a, b)| a.ptr_eq(b)) |
| 1696 | } |
| 1697 | |
| 1698 | /// Converts this [`ArrayData`] into an [`ArrayDataBuilder`] |
| 1699 | pub fn into_builder(self) -> ArrayDataBuilder { |
no test coverage detected