Skip to content

JNI changes for range-extents in window functions. - #13199

Merged
rapids-bot[bot] merged 3 commits into
NVIDIA:branch-23.06from
mythrocks:string-orderby-range-window-jni
Apr 24, 2023
Merged

rapids-bot[bot] merged 3 commits into
NVIDIA:branch-23.06from
mythrocks:string-orderby-range-window-jni

Conversation

@mythrocks

Copy link
Copy Markdown
Contributor

This commit adds back-end JNI changes to support explicit range-extents for ranged window functions. The change is analogous to the addition of cudf::range_window_bounds::extent_type, in libcudf. This change will allow for STRING order-by columns for range window functions. It is required because without it, it would be impossible to differentiate between UNBOUNDED and CURRENT ROW for a window function over a STRING order-by column.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

This commit adds back-end JNI changes to support explicit range-extents for ranged window functions.
The change is analogous to the addition of `cudf::range_window_bounds::extent_type`, in `libcudf`.
This change will allow for `STRING` order-by columns for range window functions. It is required because
without it, it would be impossible to differentiate between `UNBOUNDED` and `CURRENT ROW` for a window
function over a `STRING` order-by column.
@mythrocks mythrocks added feature request New feature or request Spark Functionality that helps Spark RAPIDS non-breaking Non-breaking change labels Apr 21, 2023
@mythrocks mythrocks self-assigned this Apr 21, 2023
@mythrocks
mythrocks requested a review from a team as a code owner April 21, 2023 19:03
@github-actions github-actions Bot added the Java Affects Java cuDF API. label Apr 21, 2023
@mythrocks

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 181b946 into NVIDIA:branch-23.06 Apr 24, 2023
mythrocks added a commit to NVIDIA/cudf-spark that referenced this pull request Apr 27, 2023
Closes #7883.
Depends on NVIDIA/cudf#13143, NVIDIA/cudf#13199.

This commit adds support for `STRING` order-by columns for RANGE window functions.

Before this commit, only numeric and timestamp types were supported as order-by columns in window specifications. However, it is possible to specify window frames such as follows:
```sql
SELECT COUNT(1) OVER( PARTITION BY gid ORDER BY str_col )
```
The implicit range here is `UNBOUNDED PRECEDING AND CURRENT ROW`, although explicit bounds may also be specified.
Note that range values cannot be specified here, because `STRING` does not support intervals.

This change should now allow the plugin to support `UNBOUNDED PRECEDING`, `UNBOUNDED FOLLOWING`, and `CURRENT ROW` as range window bounds, when the order-by column is `STRING`.

Signed-off-by: MithunR <[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 Java Affects Java cuDF API. non-breaking Non-breaking change Spark Functionality that helps Spark RAPIDS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants