You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "albertlockett (via GitHub)" <gi...@apache.org> on 2025/06/13 15:44:06 UTC

[I] Optimize infallible dictionary key casting in `try_new_from_builder` method [arrow-rs]

albertlockett opened a new issue, #7662:
URL: https://github.com/apache/arrow-rs/issues/7662

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   <!--
   A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for this feature, in addition to  the *what*)
   -->
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   
   In https://github.com/apache/arrow-rs/pull/7611 we added a new method to the dictionary builders called `try_new_from_builder` that allows creating a new builder with the same values, but a different type for the dictionary keys.
   
   This method uses the `PrimitiveArray::try_unary` method to do the casting, but when casting infallible types (e.g. going from u8 -> u16 keys), it would probably be faster to use `PrimitiveArray::unary_mut`.
   
   We should improve the implementation of `try_new_from_builder` to use `unary_mut` where possible. It might also be good to have add benchmark for this method as part of this work, so we could measure if there really is a performance improvement.
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features you've considered.
   -->
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   
   Discussion https://github.com/apache/arrow-rs/pull/7611/files#r2143611512


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


Re: [I] Optimize infallible dictionary key casting in `try_new_from_builder` method [arrow-rs]

Posted by "albertlockett (via GitHub)" <gi...@apache.org>.
albertlockett commented on issue #7662:
URL: https://github.com/apache/arrow-rs/issues/7662#issuecomment-2970983692

   Can assign this to me. I'll probably be able to find some time next couple weeks


-- 
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-unsubscribe@arrow.apache.org

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