XiangpengHao commented on issue #12031: URL: https://github.com/apache/datafusion/issues/12031#issuecomment-2293648389
I don't have an exact match, but the `take` kernel can be a good candidate: https://github.com/apache/arrow-rs/blob/042d725888358c73cd2a0d58868ea5c4bad778f7/arrow-select/src/take.rs#L481-L491 It basically breaks the string view array into smaller pieces and then assemble them together. Alternatively, we can also create a [builder](https://docs.rs/arrow/latest/arrow/array/type.StringViewBuilder.html), then use `append_block` to add all blocks from old array (`array.data_buffers()`) to the builder, and iterate the views, if the len is smaller than 12 bytes, we can directly call `append_value`, if it is larger than 12 bytes, then we call `append_view_unchecked`. (It is simpler than it looks) -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org