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

Remove non-empty nulls in cudf::get_json_object #14609

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions cpp/src/json/json_path.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <cudf/column/column_device_view.cuh>
#include <cudf/column/column_factories.hpp>
#include <cudf/detail/copy.hpp>
#include <cudf/detail/get_value.cuh>
#include <cudf/detail/null_mask.hpp>
#include <cudf/detail/utilities/cuda.cuh>
Expand Down Expand Up @@ -1029,11 +1030,17 @@ std::unique_ptr<cudf::column> get_json_object(cudf::strings_column_view const& c
static_cast<bitmask_type*>(validity.data()),
d_valid_count.data(),
options);
return make_strings_column(col.size(),
std::move(offsets),
std::move(chars),
col.size() - d_valid_count.value(stream),
std::move(validity));

auto result = make_strings_column(col.size(),
std::move(offsets),
std::move(chars),
col.size() - d_valid_count.value(stream),
std::move(validity));
// unmatched array query may result in unsanitized '[' value in the result
if (cudf::detail::has_nonempty_nulls(result->view(), stream)) {
result = cudf::detail::purge_nonempty_nulls(result->view(), stream, mr);
}
return result;
}

} // namespace
Expand Down