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

[FEA] Support HALF_UP and HALF_EVEN rounding to a set number of decimal places #3790

Closed
revans2 opened this issue Jan 15, 2020 · 2 comments · Fixed by #6685
Closed

[FEA] Support HALF_UP and HALF_EVEN rounding to a set number of decimal places #3790

revans2 opened this issue Jan 15, 2020 · 2 comments · Fixed by #6685
Assignees
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS

Comments

@revans2
Copy link
Contributor

revans2 commented Jan 15, 2020

Is your feature request related to a problem? Please describe.
This might need to wait for #3556 to work. There is also a lot of overlap with #1270.

We want to implement the spark functions round and bround. Each of them round a number to a set number of decimal places. One uses HALF_EVEN rounding the other uses HALF_UP rounding.

https://en.wikipedia.org/wiki/Rounding#Rounding_to_the_nearest_integer

We would like APIs to support both, for all numeric types (Floating point, Integer, and fixed point decimal when that is ready)

Describe the solution you'd like
I just want something that can do this. Not sure if a Binary op is the right way for this because it does not fit with the rest of the binary ops.

Describe alternatives you've considered
I'm not sure there is a good alternative.

@revans2 revans2 added feature request New feature or request Needs Triage Need team to review and classify labels Jan 15, 2020
@kkraus14 kkraus14 added libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS and removed Needs Triage Need team to review and classify labels Jan 21, 2020
@razajafri
Copy link
Contributor

What's the status of this feature?

@harrism
Copy link
Member

harrism commented Apr 27, 2020

#3751 (comment)

Like any feature request, needs motivation to prioritize it relative to everything else.

@codereport codereport self-assigned this Oct 20, 2020
harrism added a commit that referenced this issue Nov 8, 2020
…F_EVEN`) (#6685)

This PR is the final of 3 PRs and resolves #3790.

    Implement cudf::round floating point and integer types (HALF_UP) #6562
    Implement cudf::round floating point and integer types (HALF_EVEN) #6647
    Implement cudf::round decimal32 & decimal64 (HALF_UP and HALF_EVEN) arrow_backward

The PR to do list is as follows:

Add code for adjusted type of resulting column
Add implementation for half_up positive
Add implementation for half_up zero
Add implementation for half_up negative
Add implementation for half_even positive
Add implementation for half_even zero
Add implementation for half_even negative
Update documentation
Add basic unit tests
Add comprehensive unit tests
Refactor leveraging the factor that EVERY fixed_point function object is identical fire

Co-authored-by: Mark Harris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants