libcudf  24.04.00
strings/combine.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2023, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <cudf/column/column.hpp>
20 #include <cudf/scalar/scalar.hpp>
23 
24 #include <rmm/mr/device/per_device_resource.hpp>
25 
26 namespace cudf {
27 namespace strings {
39 enum class separator_on_nulls {
40  YES,
41  NO
42 };
43 
49  EMPTY_STRING,
51 };
52 
78 std::unique_ptr<column> join_strings(
79  strings_column_view const& input,
80  string_scalar const& separator = string_scalar(""),
81  string_scalar const& narep = string_scalar("", false),
82  rmm::cuda_stream_view stream = cudf::get_default_stream(),
83  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
84 
144 std::unique_ptr<column> concatenate(
145  table_view const& strings_columns,
146  strings_column_view const& separators,
147  string_scalar const& separator_narep = string_scalar("", false),
148  string_scalar const& col_narep = string_scalar("", false),
150  rmm::cuda_stream_view stream = cudf::get_default_stream(),
151  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
152 
200 std::unique_ptr<column> concatenate(
201  table_view const& strings_columns,
202  string_scalar const& separator = string_scalar(""),
203  string_scalar const& narep = string_scalar("", false),
205  rmm::cuda_stream_view stream = cudf::get_default_stream(),
206  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
207 
265 std::unique_ptr<column> join_list_elements(
266  lists_column_view const& lists_strings_column,
267  strings_column_view const& separators,
268  string_scalar const& separator_narep = string_scalar("", false),
269  string_scalar const& string_narep = string_scalar("", false),
272  rmm::cuda_stream_view stream = cudf::get_default_stream(),
273  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
274 
325 std::unique_ptr<column> join_list_elements(
326  lists_column_view const& lists_strings_column,
327  string_scalar const& separator = string_scalar(""),
328  string_scalar const& narep = string_scalar("", false),
331  rmm::cuda_stream_view stream = cudf::get_default_stream(),
332  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
333  // end of doxygen group
335 } // namespace strings
336 } // namespace cudf
Given a column-view of lists type, an instance of this class provides a wrapper on this compound colu...
An owning class to represent a string in device memory.
Definition: scalar.hpp:429
Given a column-view of strings type, an instance of this class provides a wrapper on this compound co...
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:187
Class definition for cudf::column.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
std::unique_ptr< column > concatenate(table_view const &strings_columns, strings_column_view const &separators, string_scalar const &separator_narep=string_scalar("", false), string_scalar const &col_narep=string_scalar("", false), separator_on_nulls separate_nulls=separator_on_nulls::YES, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Concatenates a list of strings columns using separators for each row and returns the result as a stri...
std::unique_ptr< column > join_strings(strings_column_view const &input, string_scalar const &separator=string_scalar(""), string_scalar const &narep=string_scalar("", false), rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Concatenates all strings in the column into one new string delimited by an optional separator string.
std::unique_ptr< column > join_list_elements(lists_column_view const &lists_strings_column, strings_column_view const &separators, string_scalar const &separator_narep=string_scalar("", false), string_scalar const &string_narep=string_scalar("", false), separator_on_nulls separate_nulls=separator_on_nulls::YES, output_if_empty_list empty_list_policy=output_if_empty_list::EMPTY_STRING, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Given a lists column of strings (each row is a list of strings), concatenates the strings within each...
output_if_empty_list
Setting for specifying what will be output from join_list_elements when an input list is empty.
separator_on_nulls
Setting for specifying how separators are added with null strings elements.
@ NULL_ELEMENT
Empty list will result in a null.
@ EMPTY_STRING
Empty list will result in empty string.
@ YES
Always add separators between elements.
@ NO
Do not add separators if an element is null.
Class definition for cudf::lists_column_view.
cuDF interfaces
Definition: aggregation.hpp:34
Class definitions for cudf::scalar.
Class definition for cudf::strings_column_view.
Class definitions for (mutable)_table_view