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

Support nested types in lists::contains #10548

Merged
merged 206 commits into from
Aug 22, 2022

Conversation

ttnghia
Copy link
Contributor

@ttnghia ttnghia commented Mar 30, 2022

This extends the lists::contains API to support nested types (lists + structs) with arbitrarily nested levels. As such, lists::contains will work with literally any type of input data.

In addition, the related implementation has been significantly refactored to facilitate adding new implementation.

Closes #8958.
Depends on:

@ttnghia ttnghia added feature request New feature or request 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS non-breaking Non-breaking change labels Mar 30, 2022
@ttnghia ttnghia self-assigned this Mar 30, 2022
@ttnghia ttnghia added this to PR-WIP in v22.06 Release via automation Mar 30, 2022
cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/src/lists/contains.cu Show resolved Hide resolved
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Comments attached.

cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/src/lists/contains.cu Show resolved Hide resolved
cpp/src/lists/contains.cu Show resolved Hide resolved
cpp/src/lists/contains.cu Show resolved Hide resolved
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

A few more comments -- I think I will approve when these are addressed. There's a lot going on in this PR and I've tried my best to make sense of it, but there's a lot of "patterning" with complex lambdas, boolean template dispatches, etc. I am struggling to find better recommendations but I don't think I can concretely identify what I would prefer in those cases, if anything, at this time.

cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/src/lists/contains.cu Show resolved Hide resolved
cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/tests/lists/contains_tests.cpp Outdated Show resolved Hide resolved
Signed-off-by: Nghia Truong <nghiatruong.vn@gmail.com>
Signed-off-by: Nghia Truong <nghiatruong.vn@gmail.com>
Signed-off-by: Nghia Truong <nghiatruong.vn@gmail.com>
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 ttnghia requested a review from bdice August 18, 2022 05:31
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

One minor comment, otherwise LGTM.

auto const lists = [] {
auto offsets = indices_col{0, 4, 7, 10, 15, 18, 21, 24, 24, 28, 28};
// clang-format off
auto data1 = tdata_col{0, 1, 2, 1, //
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the trailing // necessary if clang-format is already turned off in this section? I'd remove the trailing //.

v22.10 Release automation moved this from PR-Needs review to PR-Reviewer approved Aug 22, 2022
Signed-off-by: Nghia Truong <nghiatruong.vn@gmail.com>
@ttnghia
Copy link
Contributor Author

ttnghia commented Aug 22, 2022

Rerun tests.

@ttnghia
Copy link
Contributor Author

ttnghia commented Aug 22, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 8f3cc74 into rapidsai:branch-22.10 Aug 22, 2022
v22.10 Release automation moved this from PR-Reviewer approved to Done Aug 22, 2022
@ttnghia ttnghia deleted the lists_contains_for_structs branch August 23, 2022 04:33
rapids-bot bot pushed a commit that referenced this pull request Aug 25, 2022
On some systems, CUDA compiler may have an issue such that it will throw unused variables warnings into your face if you use `if constexpr` with an `else` branch. Such warnings were reported due to a recent merged PR (#10548).

This PR rewrites the `else` branch of the `if constexpr` in `lists/contains.cu` into a second `if constexpr` statement with opposite condition to avoid the warnings.

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

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Bradley Dice (https://github.com/bdice)
  - Mark Harris (https://github.com/harrism)

URL: #11581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Spark Functionality that helps Spark RAPIDS
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[FEA] support lists::contains on lists of structs.
5 participants