You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Ted-Jiang (via GitHub)" <gi...@apache.org> on 2023/02/03 09:47:36 UTC

[GitHub] [arrow-rs] Ted-Jiang opened a new issue, #3655: Support `as_mut_any` in Array trait

Ted-Jiang opened a new issue, #3655:
URL: https://github.com/apache/arrow-rs/issues/3655

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   now  Array trait only support `as_any`
   
   https://github.com/apache/arrow-rs/blob/9728c676b50b19c06643a23daba4aa4a1dc48055/arrow-array/src/array/mod.rs#L72-L106
   
   When I implementing  using copy on write to evaluate `col_x+1` binary_expr,
   I need cast `ArrayRef` to `PrimitiveArray` with ownership and with strong reference one😩 then pass to `unary_mut`.
   
   https://github.com/apache/arrow-rs/blob/26ea71cefab55990ffb8197707f2a8518e41412d/arrow-arith/src/arity.rs#L59-L65
   
   So i decide using `downcast_mut` then use `mem::take()` get the ` array: PrimitiveArray<I>, `
   
   But there no  `as_any_mut` , so i try to add this func πŸ€”.
   Seems there already one in `ArrayBuilder`
   https://github.com/apache/arrow-rs/blob/f0be9da82cbd76da3042b426daf6c424c9560d93/arrow-array/src/builder/mod.rs#L129
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   
   **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.
   -->
   


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


[GitHub] [arrow-rs] Ted-Jiang commented on issue #3655: Support `as_mut_any` in Array trait

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

   seems both solution use `T::from(array.data().clone())` will  +1 to `array.data()` strong reference.


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


[GitHub] [arrow-rs] alamb commented on issue #3655: Support `as_mut_any` in Array trait

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

   I think this is a similar ask to https://github.com/apache/arrow-rs/issues/2901
   
   There is somewhat of a workaround listed https://github.com/apache/arrow-rs/issues/2901#issuecomment-1293809738 
   
   I wonder if that would work?


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


[GitHub] [arrow-rs] Ted-Jiang closed issue #3655: Support `as_mut_any` in Array trait

Posted by "Ted-Jiang (via GitHub)" <gi...@apache.org>.
Ted-Jiang closed issue #3655: Support `as_mut_any`  in Array trait 
URL: https://github.com/apache/arrow-rs/issues/3655


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


[GitHub] [arrow-rs] tustvold commented on issue #3655: Support `as_mut_any` in Array trait

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

   > seems both solution use T::from(array.data().clone()) will +1 to array.data() strong reference.
   
   Provided you then proceed to drop the `ArrayRef` that is fine?


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


[GitHub] [arrow-rs] Ted-Jiang commented on issue #3655: Support `as_mut_any` in Array trait

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

   @tustvold @alamb Plz help take a look πŸ˜„


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


[GitHub] [arrow-rs] tustvold commented on issue #3655: Support `as_mut_any` in Array trait

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

   Why not use https://docs.rs/arrow-array/latest/arrow_array/cast/fn.downcast_array.html, this would avoid needing to use take


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