zeroshade commented on issue #184: URL: https://github.com/apache/arrow-go/issues/184#issuecomment-2468927533
Hey @fwojciec I'd love to get this cast in. Here's a quick overview of what would be necessary to do so, I'll happily review any PR you make: 1. The top-level of the casts for strings can be found here: https://github.com/apache/arrow-go/blob/main/arrow/compute/cast.go#L519. The calls to `addFn` are for adding casts based on the *source* type and associating compute kernels for casting to them. 2. The kernels set up [here](https://github.com/apache/arrow-go/blob/main/arrow/compute/internal/kernels/string_casts.go#L388) based on the output type, by calling `addToBinaryKernels` to add the appropriate casting kernels for String/LargeString/Binary/LargeBinary by using generics. 3. You'll need to create a new function for casting to StringView/BinaryView since they don't have "Large" variants like String and Binary (for example, notice that there are separate `Cast*Fsb*` functions for handling Fixed Size Binary types). You could then add it to the kernels appended by [`addToBinaryKernels`](https://github.com/apache/arrow-go/blob/main/arrow/compute/internal/kernels/string_casts.go#L181) in the same way as we do for fixed-size-binary. 4. Finally, unit tests can be added here: https://github.com/apache/arrow-go/blob/main/arrow/compute/cast_test.go#L1489 when you are done. If you run into any issues or difficulties, feel free to put up a draft PR and ping me and I'll help out! Thanks again for looking into 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
