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/04/11 22:05:41 UTC
[GitHub] [arrow-rs] alamb opened a new issue, #1540: Implement `string_concat` kernel
alamb opened a new issue, #1540:
URL: https://github.com/apache/arrow-rs/issues/1540
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
We currently have a `concat` kernel at https://docs.rs/arrow/11.1.0/arrow/compute/kernels/concat/index.html
This concatenates Arrays together.
There is also a need to concatenate strings together. Something like `string_concat` that takes two StringArrays (or LargeStringArrays` and concatenates them element by element.
DataFusion has an implementation of string concat here: https://github.com/apache/arrow-datafusion/blob/28a6da3d2d175eb9d2f4ff8a6ea58e7c22dae97c/datafusion/physical-expr/src/expressions/binary.rs#L422 which @WinkerDu has kindly been improving.
**Describe the solution you'd like**
I suggest adding an optimized `string_concat` kernel in `arrow-rs`. @Dandandan outlines some good first optimizations here: https://github.com/apache/arrow-datafusion/pull/2183#discussion_r846838079
The signature would be something like:
```rust
pub fn string_concat<OffsetSize: StringOffsetSizeTrait>(
left: &GenericStringArray<OffsetSize>,
right: &GenericStringArray<OffsetSize>
) -> Result<GenericStringArray<OffsetSize>>
```
An example use:
```rust
let left = [Some("foo"), Some("bar"), None].into_iter().collect::<StringArray>();
let right = [None, Some("yyy"), Some("zzz")].into_iter().collect::<StringArray>();
let res = string_concat(left, right).unwrap();
let expected = [None, Some("baryyy"), None].into_iter().collect::<StringArray>();
assert_eq(res, expected);
```
**Describe alternatives 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] alamb closed issue #1540: Implement `string_concat` kernel
Posted by GitBox <gi...@apache.org>.
alamb closed issue #1540: Implement `string_concat` kernel
URL: https://github.com/apache/arrow-rs/issues/1540
--
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