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

Implement cudf::rolling for decimal32 and decimal64 #7037

Merged
merged 4 commits into from
Dec 31, 2020

Conversation

codereport
Copy link
Contributor

@codereport codereport commented Dec 18, 2020

This PR resolves a part of #3556.

Aggregation ops supported:

  • MIN
  • MAX
  • COUNT (both null_policy - EX/INCLUDE)
  • LEAD
  • LAG

To Do List:

  • Basic unit tests
  • Comprehensive unit tests
  • Implementation
  • Figure out which rolling ops to suppport

@codereport codereport added feature request New feature or request 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Dec 18, 2020
@codereport codereport self-assigned this Dec 18, 2020
@codecov
Copy link

codecov bot commented Dec 18, 2020

Codecov Report

Merging #7037 (4ccf19d) into branch-0.18 (277bd9f) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.18    #7037      +/-   ##
===============================================
+ Coverage        82.09%   82.11%   +0.02%     
===============================================
  Files               97       97              
  Lines            16477    16480       +3     
===============================================
+ Hits             13527    13533       +6     
+ Misses            2950     2947       -3     
Impacted Files Coverage Δ
python/cudf/cudf/_fuzz_testing/fuzzer.py 0.00% <0.00%> (ø)
python/cudf/cudf/utils/hash_vocab_utils.py 100.00% <0.00%> (ø)
python/cudf/cudf/core/abc.py 91.48% <0.00%> (+4.25%) ⬆️
python/cudf/cudf/utils/gpu_utils.py 58.53% <0.00%> (+4.87%) ⬆️

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 277bd9f...4ccf19d. Read the comment docs.

@codereport codereport marked this pull request as ready for review December 29, 2020 21:31
@codereport codereport requested a review from a team as a code owner December 29, 2020 21:31
@codereport codereport requested review from cwharris, jrhemstad, rgsl888prabhu and karthikeyann and removed request for cwharris and jrhemstad December 29, 2020 21:31
return data_type{type_to_id<target_type_t<Source, k>>()};
auto const id = type_to_id<target_type_t<Source, k>>();
return id == type_id::DECIMAL32 || id == type_id::DECIMAL64 ? data_type{id, type.scale()}
: data_type{id};
Copy link
Contributor

Choose a reason for hiding this comment

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

why skip scale for non-decimal type? (It will have default value, anyway it won't be used).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ctor with scale only designed to be called for Decimal types.

  explicit data_type(type_id id, int32_t scale) : _id{id}, _fixed_point_scale{scale}
  {
    assert(id == type_id::DECIMAL32 || id == type_id::DECIMAL64);
  }

Copy link
Contributor

@rgsl888prabhu rgsl888prabhu left a comment

Choose a reason for hiding this comment

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

Looks good, just a question.

cpp/tests/rolling/rolling_test.cpp Show resolved Hide resolved
Copy link
Contributor

@vuule vuule left a comment

Choose a reason for hiding this comment

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

Surprisingly small change 👍

@codereport codereport added 6 - Okay to Auto-Merge and removed 2 - In Progress Currently a work in progress labels Dec 31, 2020
@rapids-bot rapids-bot bot merged commit 28d18d6 into rapidsai:branch-0.18 Dec 31, 2020
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. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants