tustvold commented on issue #6360: URL: https://github.com/apache/arrow-rs/issues/6360#issuecomment-2498027393
> that [we](https://github.com/rerun-io/rerun) need to solve is the capacity of repeated concat:ination It sounds like https://github.com/apache/arrow-rs/issues/6692 might be what you're actually wanting as a long-term API, although this will require someone very familiar with the arrow codebase to meaningfully action. > But how would it work in practice - dynamically downcasting a dyn Array to all possible subtypes that we have implemented shrink_to_fit for? Pretty much, there are macros to make this slightly less obnoxious. > Is there something similar I can take a look at and use as a template? Pretty much all the kernels do some variation of this ___ That all being said, shrink_to_fit can just implement the basic logic, and if/when we add a compact kernel that can simply call shrink_to_fit. This could allow progress to be made on this now. Regarding the consuming vs non-consuming versions, etc... one idea might be to just have: ``` /// Shrink any unshared buffers fn shrink_to_fit(&mut self); ``` And then use `Arc::get_mut`, this would prohibit shrinking a shared array, I couldn't tell from the links whether the desire is to get a compact deep clone, or just a best-effort optimisation of unshared buffers -- 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]
