libcudf  24.04.00
multibyte_split.hpp
1 /*
2  * Copyright (c) 2021-2022, 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 
17 #pragma once
18 
19 #include <cudf/column/column.hpp>
20 #include <cudf/io/text/byte_range_info.hpp>
21 #include <cudf/io/text/data_chunk_source.hpp>
22 
23 #include <rmm/mr/device/device_memory_resource.hpp>
24 #include <rmm/mr/device/per_device_resource.hpp>
25 
26 #include <memory>
27 #include <optional>
28 
29 namespace cudf {
30 namespace io {
31 namespace text {
32 
36 struct parse_options {
40  byte_range_info byte_range = create_byte_range_info_max();
44  bool strip_delimiters = false;
45 };
46 
85 std::unique_ptr<cudf::column> multibyte_split(
86  data_chunk_source const& source,
87  std::string const& delimiter,
88  parse_options options = {},
89  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
90 
91 std::unique_ptr<cudf::column> multibyte_split(
92  data_chunk_source const& source,
93  std::string const& delimiter,
94  std::optional<byte_range_info> byte_range,
95  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
96 
97 std::unique_ptr<cudf::column> multibyte_split(data_chunk_source const& source,
98  std::string const& delimiter,
99  rmm::mr::device_memory_resource* mr);
100 
101 } // namespace text
102 } // namespace io
103 } // namespace cudf
stores offset and size used to indicate a byte range
a data source capable of creating a reader which can produce views of the data source in device memor...
Class definition for cudf::column.
cuDF interfaces
Definition: aggregation.hpp:34
Parsing options for multibyte_split.
byte_range_info byte_range
Only rows starting inside this byte range will be part of the output column.
bool strip_delimiters
Whether delimiters at the end of rows should be stripped from the output column.