Skip to content

Commit

Permalink
add utility call to json_path and concatenate
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Jun 21, 2021
1 parent bac5812 commit e12a715
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cpp/src/strings/copying/concatenate.cu
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <cudf/detail/utilities/cuda.cuh>
#include <cudf/detail/utilities/vector_factories.hpp>
#include <cudf/strings/detail/concatenate.hpp>
#include <cudf/strings/detail/utilities.hpp>
#include <cudf/strings/strings_column_view.hpp>
#include <cudf/table/table_device_view.cuh>

Expand Down Expand Up @@ -226,9 +227,8 @@ std::unique_ptr<column> concatenate(host_span<column_view const> columns,
std::any_of(columns.begin(), columns.end(), [](auto const& col) { return col.has_nulls(); });

// create chars column
auto chars_column =
make_numeric_column(data_type{type_id::INT8}, total_bytes, mask_state::UNALLOCATED, stream, mr);
auto d_new_chars = chars_column->mutable_view().data<char>();
auto chars_column = create_chars_child_column(total_bytes, stream, mr);
auto d_new_chars = chars_column->mutable_view().data<char>();
chars_column->set_null_count(0);

// create offsets column
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/strings/json/json_path.cu
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <cudf/detail/utilities/cuda.cuh>
#include <cudf/detail/utilities/vector_factories.hpp>
#include <cudf/scalar/scalar.hpp>
#include <cudf/strings/detail/utilities.hpp>
#include <cudf/strings/json.hpp>
#include <cudf/strings/string_view.cuh>
#include <cudf/strings/strings_column_view.hpp>
Expand Down Expand Up @@ -964,8 +965,7 @@ std::unique_ptr<cudf::column> get_json_object(cudf::strings_column_view const& c
cudf::detail::get_value<offset_type>(offsets_view, col.size(), stream);

// allocate output string column
auto chars = cudf::make_fixed_width_column(
data_type{type_id::INT8}, output_size, mask_state::UNALLOCATED, stream, mr);
auto chars = create_chars_child_column(output_size, stream, mr);

// potential optimization : if we know that all outputs are valid, we could skip creating
// the validity mask altogether
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/strings/utilities.cu
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ std::unique_ptr<cudf::column> child_chars_from_string_vector(cudf::device_span<s
auto const d_offsets = offsets.data<int32_t>();

// create column
auto chars_column =
make_numeric_column(data_type{type_id::INT8}, bytes, mask_state::UNALLOCATED, stream, mr);
auto chars_column = create_chars_child_column(bytes, stream, mr);
// get it's view
auto d_chars = chars_column->mutable_view().data<char>();
thrust::for_each_n(rmm::exec_policy(stream),
Expand Down

0 comments on commit e12a715

Please sign in to comment.