andishgar commented on issue #46485: URL: https://github.com/apache/arrow/issues/46485#issuecomment-2903984104
@Kou, I have several questions regarding the` CopyTo` and` ViewOrCopy` operations. I understand that `arrow::Array` is designed to be immutable, and based on that design, it's acceptable to share buffer ownership among multiple arrays (as I've seen in the casting compute function). However, when performing a deep copy on an `arrow::Array` , the intent is to produce a new array with its own unique buffer. Given this logic, it seems the current implementation should be modified to copy the` arrow::ArrayStatistics` instead of creating a new one during the copy operation. https://github.com/apache/arrow/blob/8afaf95b38459f97ab12b22ebb7e1913b31025bf/cpp/src/arrow/array/data.cc#L167-L169 1- Is my observation correct 2- Can the following code be used to distinguish between View and Copy operations on an `arrow::Buffer`? ```c++ buffer_in->data() == buffer_out->data() ``` By the way, if the answer to question one is yes, I'd like to address that first -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org