-
Notifications
You must be signed in to change notification settings - Fork 917
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
Support DECIMAL order-by for RANGE window functions #11645
Support DECIMAL order-by for RANGE window functions #11645
Conversation
CUDF grouped RANGE window functions currently support only integral types and timestamps as the ORDER BY (OBY) column. This commit adds support for DECIMAL types (i.e. decimal32, decimal64, and decimal128) columns to by used as the ORDER BY column in RANGE window functions.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## branch-22.10 #11645 +/- ##
===============================================
Coverage ? 86.42%
===============================================
Files ? 145
Lines ? 23014
Branches ? 0
===============================================
Hits ? 19890
Misses ? 3124
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: MithunR <[email protected]>
Plus, scaling.
Signed-off-by: MithunR <[email protected]>
With the benefit of hindsight, I see that I could have also supported decimal range bounds with scales lower than that of the order-by column, simply by scaling in the other direction. The fear at the time was the loss of precision when scaling to a higher scale, but that should also apply in the other direction. I am not rocking the boat now. I'll raise an issue to tackle that separately from this PR. |
Also, fixed grammar error in a code comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice and clean, thanks for making this change!
1. Better documentation of how decimals are compared. 2. enable_if_t<> => CUDF_ENABLE_IF(). 3. Better names for test typedefs.
1. Removed extra whitespaces, unnecessary comments. 2. Fixed copyright date. 3. Reused `big()` helper function. 4. Updated `Scalar.equals()` to include DECIMAL128. Signed-off-by: MithunR <[email protected]>
Thank you for the reviews, all. I'll merge this change after CI is done cranking. |
@gpucibot merge |
…11710) As a follow-up to #11645, this change includes `DECIMAL` among the list of data-types that may be used in the order-by column for `RANGE`-based window functions, listed in the exception message. Authors: - MithunR (https://github.com/mythrocks) Approvers: - Gera Shegalov (https://github.com/gerashegalov) - Nghia Truong (https://github.com/ttnghia) URL: #11710
This commit adds support for `FLOAT32` and `FLOAT64` order-by columns for RANGE-based window functions. ## Background Up until this commit, order-by columns for RANGE window functions were allowed to be integral numerics, timestamps, or strings (for unbounded/current rows). With this commit, window functions will be permitted to run on floating point value ranges. E.g. This supports windows defined with floating point deltas, like `rows with values exceeding the current row by no more than 3.14f`. This is in the same vein as the support for `DECIMAL` (#11645) and `STRING` (#13143). Authors: - MithunR (https://github.com/mythrocks) Approvers: - Nghia Truong (https://github.com/ttnghia) - David Wendt (https://github.com/davidwendt) URL: #13512
Description
CUDF grouped RANGE window functions currently support only
integral types and timestamps as the ORDER BY (OBY) column.
This commit adds support for DECIMAL types (i.e. decimal32,
decimal64, and decimal128) to be used as the ORDER BY
column in RANGE window functions.
This feature allows
spark-rapids
to address NVIDIA/spark-rapids#6400.Checklist