-
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
Fix calls to deprecated strings factory API #14771
Changes from 6 commits
a9a5959
32bfbb0
c738c05
4bd179b
20b7f10
ac8a8de
f5552fe
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2019-2023, NVIDIA CORPORATION. | ||
* Copyright (c) 2019-2024, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -89,9 +89,8 @@ std::unique_ptr<column> merge(strings_column_view const& lhs, | |
auto d_offsets = offsets_column->view().template data<int32_t>(); | ||
|
||
// create the chars column | ||
auto chars_column = strings::detail::create_chars_child_column(bytes, stream, mr); | ||
// merge the strings | ||
auto d_chars = chars_column->mutable_view().template data<char>(); | ||
rmm::device_uvector<char> chars(bytes, stream, mr); | ||
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. Why do we prefer a 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. On further thought, maybe it's just nicer to have the typed container than a raw buffer. It plays well with our sync/async vector factories and the 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. Typing aids in handling the remaining code that would have needed casting. Additionally, the inline call to |
||
auto d_chars = chars.data(); | ||
thrust::for_each_n(rmm::exec_policy(stream), | ||
thrust::make_counting_iterator<size_type>(0), | ||
strings_count, | ||
|
@@ -103,11 +102,8 @@ std::unique_ptr<column> merge(strings_column_view const& lhs, | |
memcpy(d_chars + d_offsets[idx], d_str.data(), d_str.size_bytes()); | ||
}); | ||
|
||
return make_strings_column(strings_count, | ||
std::move(offsets_column), | ||
std::move(chars_column), | ||
null_count, | ||
std::move(null_mask)); | ||
return make_strings_column( | ||
strings_count, std::move(offsets_column), chars.release(), null_count, std::move(null_mask)); | ||
} | ||
|
||
} // namespace detail | ||
|
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.
The repeating pattern
chars->release().data.release()[0]
throughout this PR is a bit awkward. This relates to my comment about refactoringmake_strings_children
to return a buffer.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.
Hopefully the awkwardness is only temporary once the new utility is created.