-
Notifications
You must be signed in to change notification settings - Fork 915
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
Add struct utility functions. #10776
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,6 +441,12 @@ std::tuple<cudf::table_view, std::vector<rmm::device_buffer>> superimpose_parent | |
return {table_view{superimposed_columns}, std::move(superimposed_nullmasks)}; | ||
} | ||
|
||
bool contains_null_structs(column_view const& col) | ||
{ | ||
return (is_struct(col) && col.has_nulls()) || | ||
std::any_of(col.child_begin(), col.child_end(), contains_null_structs); | ||
} | ||
|
||
Comment on lines
+444
to
+449
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that this is very short, I wonder why don't we inline it in the header? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't agree with this assessment for moving a function to a header. Moving it to a header may require additional includes in the header that are unnecessary to the caller. I think we should only inline host functions in headers when absolutely necessary. It can improve compile time and also perhaps encapsulation such that changing the implementation (as in this case) would not require recompiling all the source files that include the header. |
||
} // namespace detail | ||
} // namespace structs | ||
} // namespace cudf |
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, given that this is for the legacy flattening, I suspect the need for this function will go away with using the new comparators. It's fine to merge for now, but just keep this in mind.