Rich-T-kid commented on code in PR #12088:
URL: https://github.com/apache/arrow-rs/pull/12088#discussion_r4486199301
##########
arrow-array/src/array/mod.rs:
##########
@@ -432,6 +432,18 @@ pub unsafe trait Array: std::fmt::Debug + Send + Sync {
/// A reference-counted reference to a generic `Array`
pub type ArrayRef = Arc<dyn Array>;
+/// Returns `true` if two child value arrays have the same layout and backing
buffers.
+///
+/// This is useful for recognizing shared values in [`DictionaryArray`] and
[`RunArray`].
+/// It first checks whether the [`ArrayRef`]s point to the same allocation,
then falls back
+/// to [`ArrayData::ptr_eq`] to recognize shallow clones such as
`Arc::new(array.clone())`.
+///
+/// This checks storage identity, not logical equality: arrays with equal
values but
+/// different buffers return `false`.
Review Comment:
will do
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]