-
Notifications
You must be signed in to change notification settings - Fork 902
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
extract_list_elements() with column_view indices #9367
extract_list_elements() with column_view indices #9367
Conversation
Fixes rapidsai#9172. Adds an overload of `extract_list_element()` where the indices may be specified as a `column_view`. This function returns a list element from a potentially different index, for each list row. The semantics of the scalar-index version of the function are retained. i.e.: 0. The index is 0-based. 1. `if (list_row == null) return null;` 2. `if (index > list_row.size()) return null;` 3. `if (index == null) return null;` 4. `if (index < 0 || -index <= length) return list_row[length + index];` This commit also reworks `extract_list_element(list, size_type, stream)`, to use `segmented_gather()`.
Codecov Report
@@ Coverage Diff @@
## branch-21.12 #9367 +/- ##
================================================
- Coverage 10.79% 10.74% -0.05%
================================================
Files 116 116
Lines 18869 19503 +634
================================================
+ Hits 2036 2096 +60
- Misses 16833 17407 +574
Continue to review full report at Codecov.
|
Are you testing me? In order for the second clause to be evaluated,
Can you state #4 in English for clarity? Edit: Oh, I think you mean |
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.
Looks good. Mostly doc improvements.
Rerun tests |
Thank you for the reviews, and thought-provoking discussion, all. I'm merging this now. |
@gpucibot merge |
Fixes #9172.
Adds an overload of
extract_list_element()
where the indicesmay be specified as a
column_view
.This function returns a list element from a potentially different index,
for each list row. The semantics of the scalar-index version of the function
are retained. i.e.:
if (list_row == null) return null;
if (index > list_row.size()) return null;
if (index == null) return null;
if (index < 0 && -index <= length) return list_row[length + index];
This commit also reworks
extract_list_element(list, size_type, stream)
,to use
segmented_gather()
, as per the advice in #9214.