ding-young opened a new issue, #8230:
URL: https://github.com/apache/arrow-rs/issues/8230

   **Describe the bug**
   <!--
   A clear and concise description of what the bug is.
   -->
   It is found (in https://github.com/apache/datafusion/pull/17029) that 
`get_sliced_memory_size` underestimated the memory size for `StringViewArray`. 
The diff was quite large i.e. when correct batch size was `1392730` bytes, it 
returned only `163840` bytes. 
   
   This is because payload buffers are not taken account of although these 
payload buffers are simply `cloned()` when we `slice()` `StringViewArray`  
   
   See
   
https://github.com/apache/arrow-rs/blob/a620957bc98b7aa14faec10635bb798932f00bf9/arrow-data/src/data.rs#L464-L476
   
https://github.com/apache/arrow-rs/blob/a620957bc98b7aa14faec10635bb798932f00bf9/arrow-data/src/data.rs#L1743-L1752
   
   **To Reproduce**
   <!--
   Steps to reproduce the behavior:
   -->
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   `get_sliced_memory_size` should include the capacity for payload buffers. 
   If this fix isn’t ideal, we should at least document which buffers are being 
counted in the calculation.
   
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->
   https://github.com/apache/datafusion/pull/17315 
   here's related pr for temporal fix in datafusion 
   


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

Reply via email to