[C++] Better support optional start/stop in "utf8_slice_codeunits" kernel
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the bug, including details regarding any error messages, version, and platform.
There have been various (slightly different) bugs reported about using "utf8_slice_codeunits" with optional `start` or `stop`. The `stop` argument is already optional and translated into the largest int to indicate to always slice until the end, but that internal "workaround" also produces some bugs in the current implementation due to integer overflows.
Potentially, we could use a different mechanism to signal a default start/stop, such as using `std::optional` instead of `std::numeric_limits::max()`
Listing the related issues:
* https://github.com/apache/arrow/issues/28940
* https://github.com/apache/arrow/issues/14991
* https://github.com/apache/arrow/issues/34917
* https://github.com/apache/arrow/issues/34928
The option class is also used for "binary_slice" kernel.
### Component(s)
C++
Contributor guide
Assessment
This issue has not been assessed yet.