[FEA] Add a sentinel `constexpr` value to denote `INVALID_INDEX`
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
Currently, various cudf APIs need to use a special constant to denote an **invalid** row index for certain operations. However, there is not any guideline on what constant should be used to mark an invalid index row. Therefore, different APIs implement their own `INVALID_INDEX` constant.
For example:
* `lists/explode.cu`: `constexpr size_type InvalidIndex = -1;`
* `detail/scatter.cuh`: `std::numeric_limits::lowest()` is used
* `lists/extract.cu`: `std::numeric_limits::max()` is used
And maybe more. As such, the constants used for `INVALID_INDEX` is not agreed across cudf development. We should explicitly add a sentinel constant in some of cudf main header and replace the existing ones with it. By doing so, we can enforce consistency and reduce confusion (why this file uses `-1` while other file uses `numeric_limit::lowest()` or `numeric_limit::max()`).
Contributor guide
Assessment
This issue has not been assessed yet.