Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cudf::strings::is_fixed_point checking of overflow for decimal32 #9093

Merged

Conversation

davidwendt
Copy link
Contributor

While working on decimal128 support, @codereport found a bug in the cudf::strings::is_fixed_point logic where a large integer (in a strings column) could return true/valid even though it overflows the Rep type for decimal32 type. The gtest values did not include a value that would have shown this error. This PR adds the test string and fixes the logic properly check the overflow condition.

The current logic was relying on storing intermediate values into uint64_t types so any number that would fit in uint64_t would not be detected as overflow for decimal32. This PR fixes functions to use the input type storage type more to help identify the overflow correctly and to help with specializing for decimal128.

@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. strings strings issues (C++ and Python) non-breaking Non-breaking change labels Aug 23, 2021
@davidwendt davidwendt self-assigned this Aug 23, 2021
@davidwendt davidwendt requested a review from a team as a code owner August 23, 2021 20:47
@codecov
Copy link

codecov bot commented Aug 23, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.10@406e87b). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.10    #9093   +/-   ##
===============================================
  Coverage                ?   10.73%           
===============================================
  Files                   ?      114           
  Lines                   ?    19060           
  Branches                ?        0           
===============================================
  Hits                    ?     2046           
  Misses                  ?    17014           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 406e87b...1a35ab4. Read the comment docs.

Copy link
Contributor

@codereport codereport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 (one small doc fix)

cpp/include/cudf/strings/detail/convert/fixed_point.cuh Outdated Show resolved Hide resolved
@codereport
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit d29c441 into rapidsai:branch-21.10 Aug 25, 2021
@davidwendt davidwendt deleted the bug-strings-is-fixed-point branch November 8, 2021 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change strings strings issues (C++ and Python)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants