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

Use cudf::lists::distinct in Java binding #11233

Merged
merged 42 commits into from
Jul 19, 2022

Conversation

ttnghia
Copy link
Contributor

@ttnghia ttnghia commented Jul 8, 2022

Java binding has dropListDuplicates and dropListDuplicatesWithKeysValues APIs to create lists column having distinct list elements. Previously they have been implemented by calling to cudf::lists::drop_list_duplicates, which relies on stably sorting the input lists column to extract unique list elements.

This PR makes the following changes:

  • Modifying the underlying implementation of dropListDuplicates to use cudf::lists::distinct, which has O(n) time complexity, and
  • Adding a new JNI-dedicated function cudf::jni::lists_distinct_by_key so dropListDuplicatesWithKeysValues will call it instead of cudf::lists::drop_list_duplicates. This function with keys-values pair input is only needed by Spark's create_map function so its implementation will be kept inside the JNI layer instead of in libcudf.

@github-actions github-actions bot removed the libcudf Affects libcudf (C++/CUDA) code. label Jul 12, 2022
@ttnghia ttnghia removed the 0 - Blocked Cannot progress due to external reasons label Jul 12, 2022
@ttnghia ttnghia marked this pull request as ready for review July 12, 2022 23:34
@ttnghia ttnghia requested a review from a team as a code owner July 12, 2022 23:34
@ttnghia ttnghia requested a review from mythrocks July 13, 2022 13:15
Copy link
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

Good work!

One minor documentation rephrasing requested. Plus, we've relaxed the requirement for non-sliced input columns; we should add a test to confirm.

@ttnghia ttnghia requested a review from mythrocks July 18, 2022 21:38
Copy link
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

LGTM!

@ttnghia
Copy link
Contributor Author

ttnghia commented Jul 19, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit b2dd1bf into rapidsai:branch-22.08 Jul 19, 2022
@ttnghia ttnghia deleted the use_lists_distinct_in_java branch July 19, 2022 02:40
rapids-bot bot pushed a commit that referenced this pull request Jul 22, 2022
This PR completely removes `cudf::lists::drop_list_duplicates`. It is replaced by the new API `cudf::list::distinct` which has a simpler implementation but better performance. The replacements for internal cudf usage have all been merged before thus there is no side effect or breaking for the existing APIs in this work.

Closes #11114, #11093, #11053, #11034, and closes #9257.

Depends on:
 * #11228
 * #11149
 * #11234
 * #11233

Authors:
  - Nghia Truong (https://github.com/ttnghia)

Approvers:
  - Jordan Jacobelli (https://github.com/Ethyling)
  - Robert Maynard (https://github.com/robertmaynard)
  - Vukasin Milovanovic (https://github.com/vuule)
  - Bradley Dice (https://github.com/bdice)

URL: #11236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. non-breaking Non-breaking change Performance Performance related issue Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants