You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/11/03 14:04:34 UTC

[GitHub] [arrow] jhorstmann commented on a change in pull request #8561: ARROW-10449 [Rust] Make Dictionary::keys be an array

jhorstmann commented on a change in pull request #8561:
URL: https://github.com/apache/arrow/pull/8561#discussion_r516565794



##########
File path: rust/arrow/src/array/array.rs
##########
@@ -2398,30 +2311,23 @@ impl<T: ArrowPrimitiveType> Array for DictionaryArray<T> {
 
     /// Returns the total number of bytes of memory occupied by the buffers owned by this [DictionaryArray].
     fn get_buffer_memory_size(&self) -> usize {
-        self.data.get_buffer_memory_size() + self.values().get_buffer_memory_size()
+        // Since both `keys` and `values` derive (are references from) `data`, we only account for `data`.
+        self.data.get_array_memory_size()

Review comment:
       `data` contains the keys in `buffers[0]` and the values as `child_data[0]`. `self.values` is only another wrapper array, pointing to the same `child_data[0]`.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org