[FEA] Implement a more accurate float to decimal conversion that supports rounding instead of truncation
Open
feature request
libcudf
Spark
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
Currently, there not exist any accurate float-to-decimal conversion. The closest operation to it is `cudf::round` which can produce some results that are not correct all the time. As such, we have issues like https://github.com/NVIDIA/spark-rapids/issues/9682 and https://github.com/NVIDIA/spark-rapids/issues/10809.
A new dedicated conversion code in https://github.com/rapidsai/cudf/pull/15905 supposes to add some special handling for float-decimal conversion. Unfortunately, it performs truncation instead of rounding. It should be great to support an optional flag to that code, allowing to do either truncation or rounding depending on the applications.
Contributor guide
Assessment
This issue has not been assessed yet.