You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Sunyue (via GitHub)" <gi...@apache.org> on 2025/08/08 02:35:25 UTC
[I] compute. CastOptions add option to cast to null value when cast fails [arrow-go]
Sunyue opened a new issue, #463:
URL: https://github.com/apache/arrow-go/issues/463
### Describe the enhancement requested
I am using `compute. CastArray` and `compute. CastToType` for casting an array to a compatible type. If one element in the array can not be casted, then the whole array fails. Is it possible to set those failed ones to null value while casting the remaining of the array successfully? I tried setting those default cast options to true, but it seems the behavior is setting those failed ones to initial value. Thanks for your help!
### Component(s)
Other
--
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] compute. CastOptions add option to cast to null value when cast fails [arrow-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #463:
URL: https://github.com/apache/arrow-go/issues/463#issuecomment-3330625924
Hey @Sunyue I finally have the time to get around to this, sorry for the delay. Can you provide an example where you actually hit this? I've been looking at the current cast code and as far as I can tell, in most cases we just let the cast truncate or otherwise rather than erroring.
Looking closely, I think the only scenario where this might happen is when dealing with timestamps?
--
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
Re: [I] compute. CastOptions add option to cast to null value when cast fails [arrow-go]
Posted by "Sunyue (via GitHub)" <gi...@apache.org>.
Sunyue commented on issue #463:
URL: https://github.com/apache/arrow-go/issues/463#issuecomment-3332382618
Hi @zeroshade thanks for looking into this. Currently when using `compute.CastToType` and if the target type is incompatible, then by default it throws error (or value will be truncate base on existing `CastOptions`). My point is, is it possible to add an new option to allow casting to null value (instead of throwing error) if target type is incompatible?
--
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