-
Notifications
You must be signed in to change notification settings - Fork 920
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
Strong index types for equality comparator #10883
Strong index types for equality comparator #10883
Conversation
…p both weakly and strongly typed row comparators.
Co-authored-by: Nghia Truong <ttnghia@users.noreply.github.com>
Co-authored-by: Jake Hemstad <jhemstad@nvidia.com>
… flipping tables.
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.
Approving ops-codeowner
file changes
d1a5b7b
to
c51b053
Compare
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.
One small suggestion, otherwise LGTM. Thanks for your help with this, @ttnghia!
Are there new cases that can be supported by this implementation? Are tests needed for those?
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@gpucibot merge |
@ttnghia the policy is for 2 cpp approvals before merging a PR. |
Wait, I had only 1 cpp approval? Sorry I missed that, merged after seeing 2 approvals. Will pay more attention next time. |
return strong_index_comparator_adapter<device_row_comparator<Nullate>>{ | ||
device_row_comparator<Nullate>(nullate, *d_left_table, *d_right_table, nulls_are_equal)}; |
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.
fyi, CTAD is your friend.
return strong_index_comparator_adapter{device_row_comparator(nullate, *d_left_table, *d_right_table, nulls_are_equal)};
// Create a (structs) column_view of one row having children given from the input scalar. | ||
auto const needle_tv = static_cast<struct_scalar const*>(&needle)->view(); | ||
auto const needle_as_col = | ||
column_view(data_type{type_id::STRUCT}, | ||
1, | ||
nullptr, | ||
nullptr, | ||
0, | ||
0, | ||
std::vector<column_view>{needle_tv.begin(), needle_tv.end()}); |
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.
We should probably add overloads of the comparators that take a scalar for the lhs or rhs that do this automaticaly.
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.
I'm glad you mentioned this. I was thinking that would be a helpful next step as well, but I hadn't yet spent the time to identify how many times that pattern occurs.
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 would be an interesting follow up PR.
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.
Filed an issue: #10892
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.
Also filed a related FEA issue: #10893
This extends the `cudf::contains` API to support nested types (lists + structs) with arbitrarily nested levels. As such, `cudf::contains` will work with literally any type of input data. In addition, this fixes null handling of `cudf::contains` with structs column + struct scalar input when the structs column contains null rows at the top level while the scalar key is valid but all nulls at children levels. Closes: #8965 Depends on: * #10730 * #10883 * #10802 * #10997 * NVIDIA/cuCollections#172 * NVIDIA/cuCollections#173 * #11037 * #11356 Authors: - Nghia Truong (https://github.com/ttnghia) - Devavret Makkar (https://github.com/devavret) - Bradley Dice (https://github.com/bdice) - Karthikeyan (https://github.com/karthikeyann) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) - Bradley Dice (https://github.com/bdice) - Yunsong Wang (https://github.com/PointKernel) URL: #10656
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: * #10730 * #10883 * #10999 * #11019 * #11037 Authors: - Nghia Truong (https://github.com/ttnghia) - Bradley Dice (https://github.com/bdice) Approvers: - MithunR (https://github.com/mythrocks) - Bradley Dice (https://github.com/bdice) URL: #10548
This adds strong index types for equality comparator, along with #10730 to unblock #10548, #10656, and several others nested type feature requests.