strings/combine.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2024, 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 
25 #include <rmm/resource_ref.hpp>
26 
27 namespace CUDF_EXPORT cudf {
28 namespace strings {
40 enum class separator_on_nulls {
41  YES,
42  NO
43 };
44 
50  EMPTY_STRING,
52 };
53 
79 std::unique_ptr<column> join_strings(
80  strings_column_view const& input,
81  string_scalar const& separator = string_scalar(""),
82  string_scalar const& narep = string_scalar("", false),
85 
145 std::unique_ptr<column> concatenate(
146  table_view const& strings_columns,
147  strings_column_view const& separators,
148  string_scalar const& separator_narep = string_scalar("", false),
149  string_scalar const& col_narep = string_scalar("", false),
150  separator_on_nulls separate_nulls = separator_on_nulls::YES,
153 
201 std::unique_ptr<column> concatenate(
202  table_view const& strings_columns,
203  string_scalar const& separator = string_scalar(""),
204  string_scalar const& narep = string_scalar("", false),
205  separator_on_nulls separate_nulls = separator_on_nulls::YES,
208 
266 std::unique_ptr<column> join_list_elements(
267  lists_column_view const& lists_strings_column,
268  strings_column_view const& separators,
269  string_scalar const& separator_narep = string_scalar("", false),
270  string_scalar const& string_narep = string_scalar("", false),
271  separator_on_nulls separate_nulls = separator_on_nulls::YES,
272  output_if_empty_list empty_list_policy = output_if_empty_list::EMPTY_STRING,
275 
326 std::unique_ptr<column> join_list_elements(
327  lists_column_view const& lists_strings_column,
328  string_scalar const& separator = string_scalar(""),
329  string_scalar const& narep = string_scalar("", false),
330  separator_on_nulls separate_nulls = separator_on_nulls::YES,
331  output_if_empty_list empty_list_policy = output_if_empty_list::EMPTY_STRING,
334  // end of doxygen group
336 } // namespace strings
337 } // namespace CUDF_EXPORT 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:431
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:200
Class definition for cudf::column.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
cuda::mr::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
device_memory_resource * get_current_device_resource()
std::unique_ptr< column > concatenate(table_view const &strings_columns, string_scalar const &separator=string_scalar(""), string_scalar const &narep=string_scalar("", false), separator_on_nulls separate_nulls=separator_on_nulls::YES, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Row-wise concatenates the given list of strings columns and returns a single strings column result.
std::unique_ptr< column > join_list_elements(lists_column_view const &lists_strings_column, string_scalar const &separator=string_scalar(""), string_scalar const &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::device_async_resource_ref 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.
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::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Concatenates all strings in the column into one new string delimited by an optional separator string.
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.
Class definition for cudf::lists_column_view.
cuDF interfaces
Definition: aggregation.hpp:35
Class definitions for cudf::scalar.
Class definition for cudf::strings_column_view.
Class definitions for (mutable)_table_view