apache / apache/arrow

[C++] Better support optional start/stop in "utf8_slice_codeunits" kernel

Open
#34,929 3 comments 0 reactions 1 assignee Claimed by @benibus View on GitHub
Component: C++ Type: bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.