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 2022/11/10 01:49:26 UTC

[GitHub] [arrow-rs] tustvold commented on pull request #3050: Minor: Use reference in with_precision_and_scale

tustvold commented on PR #3050:
URL: https://github.com/apache/arrow-rs/pull/3050#issuecomment-1309657074

   I think a `with_` taking by reference is somewhat at odds with the rest of the codebase. It is primarily intended for use when building new array, at which point cloning the ArrayData is just an unnecessary overhead. In the downcast case you mention currently one can do
   
   ```
   DecimalArray::from(array.data().clone()).with_precision_and_scale(p, s).unwrap()
   ```
   
   i.e. explicitly clone the array data, and this is actually less verbose than downcasting it. So I'm not sure about this...


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