libcudf  24.02.00
io/types.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 
22 #pragma once
23 
24 #include <cudf/table/table.hpp>
25 #include <cudf/types.hpp>
26 #include <cudf/utilities/span.hpp>
27 
28 #include <map>
29 #include <memory>
30 #include <optional>
31 #include <string>
32 #include <unordered_map>
33 #include <vector>
34 
35 namespace cudf {
37 namespace io {
38 class data_sink;
39 class datasource;
40 } // namespace io
41 } // namespace cudf
42 
44 namespace cudf {
46 namespace io {
56 enum class compression_type {
57  NONE,
58  AUTO,
59  SNAPPY,
60  GZIP,
61  BZIP2,
62  BROTLI,
63  ZIP,
64  XZ,
65  ZLIB,
66  LZ4,
67  LZO,
68  ZSTD
69 };
70 
74 enum class io_type {
75  FILEPATH,
76  HOST_BUFFER,
78  VOID,
80 };
81 
85 enum class quote_style {
86  MINIMAL,
87  ALL,
88  NONNUMERIC,
89  NONE
90 };
91 
100 };
101 
106  public:
111 
121  size_t num_failed_bytes,
122  size_t num_skipped_bytes,
123  size_t num_compressed_output_bytes)
124  : _num_compressed_bytes(num_compressed_bytes),
125  _num_failed_bytes(num_failed_bytes),
126  _num_skipped_bytes(num_skipped_bytes),
127  _num_compressed_output_bytes(num_compressed_output_bytes)
128  {
129  }
130 
138  {
139  _num_compressed_bytes += other._num_compressed_bytes;
140  _num_failed_bytes += other._num_failed_bytes;
141  _num_skipped_bytes += other._num_skipped_bytes;
142  _num_compressed_output_bytes += other._num_compressed_output_bytes;
143  return *this;
144  }
145 
154  [[nodiscard]] auto num_compressed_bytes() const noexcept { return _num_compressed_bytes; }
155 
161  [[nodiscard]] auto num_failed_bytes() const noexcept { return _num_failed_bytes; }
162 
168  [[nodiscard]] auto num_skipped_bytes() const noexcept { return _num_skipped_bytes; }
169 
175  [[nodiscard]] auto num_total_input_bytes() const noexcept
176  {
178  }
179 
188  [[nodiscard]] auto compression_ratio() const noexcept
189  {
190  return static_cast<double>(num_compressed_bytes()) / _num_compressed_output_bytes;
191  }
192 
193  private:
194  std::size_t _num_compressed_bytes = 0;
195  std::size_t _num_failed_bytes = 0;
196  std::size_t _num_skipped_bytes = 0;
197  std::size_t _num_compressed_output_bytes = 0;
198 };
199 
204  NEVER = 0,
205  ADAPTIVE = 1,
206  ALWAYS = 2
207 };
208 
216  std::string name;
217  std::optional<bool> is_nullable;
218  std::vector<column_name_info> children;
219 
226  column_name_info(std::string const& _name, std::optional<bool> _is_nullable = std::nullopt)
227  : name(_name), is_nullable(_is_nullable)
228  {
229  }
230 
231  column_name_info() = default;
232 };
233 
238  std::vector<column_name_info>
240  std::map<std::string, std::string> user_data;
242  std::vector<std::unordered_map<std::string, std::string>>
244 };
245 
250  std::unique_ptr<table> tbl;
252 };
253 
261 struct host_buffer {
262  // TODO: to be replaced by `host_span`
263  char const* data = nullptr;
264  size_t size = 0;
265  host_buffer() = default;
272  host_buffer(char const* data, size_t size) : data(data), size(size) {}
273 };
274 
282 template <typename T>
283 constexpr inline auto is_byte_like_type()
284 {
285  using non_cv_T = std::remove_cv_t<T>;
286  return std::is_same_v<non_cv_T, int8_t> || std::is_same_v<non_cv_T, char> ||
287  std::is_same_v<non_cv_T, uint8_t> || std::is_same_v<non_cv_T, unsigned char> ||
288  std::is_same_v<non_cv_T, std::byte>;
289 }
290 
294 struct source_info {
295  source_info() = default;
296 
302  explicit source_info(std::vector<std::string> const& file_paths)
303  : _type(io_type::FILEPATH), _filepaths(file_paths)
304  {
305  }
306 
312  explicit source_info(std::string const& file_path)
313  : _type(io_type::FILEPATH), _filepaths({file_path})
314  {
315  }
316 
324  explicit source_info(std::vector<host_buffer> const& host_buffers) : _type(io_type::HOST_BUFFER)
325  {
326  _host_buffers.reserve(host_buffers.size());
328  host_buffers.end(),
329  std::back_inserter(_host_buffers),
330  [](auto const hb) {
331  return cudf::host_span<std::byte const>{
332  reinterpret_cast<std::byte const*>(hb.data), hb.size};
333  });
334  }
335 
344  explicit source_info(char const* host_data, size_t size)
345  : _type(io_type::HOST_BUFFER),
346  _host_buffers(
347  {cudf::host_span<std::byte const>(reinterpret_cast<std::byte const*>(host_data), size)})
348  {
349  }
350 
356  template <typename T, CUDF_ENABLE_IF(is_byte_like_type<std::remove_cv_t<T>>())>
357  explicit source_info(cudf::host_span<cudf::host_span<T>> const host_buffers)
358  : _type(io_type::HOST_BUFFER)
359  {
360  if constexpr (not std::is_same_v<std::remove_cv_t<T>, std::byte>) {
361  _host_buffers.reserve(host_buffers.size());
362  std::transform(host_buffers.begin(),
363  host_buffers.end(),
364  std::back_inserter(_host_buffers),
365  [](auto const s) {
366  return cudf::host_span<std::byte const>{
367  reinterpret_cast<std::byte const*>(s.data()), s.size()};
368  });
369  } else {
370  _host_buffers.assign(host_buffers.begin(), host_buffers.end());
371  }
372  }
373 
379  template <typename T, CUDF_ENABLE_IF(is_byte_like_type<std::remove_cv_t<T>>())>
380  explicit source_info(cudf::host_span<T> host_data)
381  : _type(io_type::HOST_BUFFER),
382  _host_buffers{cudf::host_span<std::byte const>(
383  reinterpret_cast<std::byte const*>(host_data.data()), host_data.size())}
384  {
385  }
386 
393  : _type(io_type::DEVICE_BUFFER), _device_buffers(device_buffers.begin(), device_buffers.end())
394  {
395  }
396 
403  : _type(io_type::DEVICE_BUFFER), _device_buffers({{d_buffer}})
404  {
405  }
406 
412  explicit source_info(std::vector<cudf::io::datasource*> const& sources)
413  : _type(io_type::USER_IMPLEMENTED), _user_sources(sources)
414  {
415  }
416 
423  : _type(io_type::USER_IMPLEMENTED), _user_sources({source})
424  {
425  }
426 
432  [[nodiscard]] auto type() const { return _type; }
438  [[nodiscard]] auto const& filepaths() const { return _filepaths; }
444  [[nodiscard]] auto const& host_buffers() const { return _host_buffers; }
450  [[nodiscard]] auto const& device_buffers() const { return _device_buffers; }
456  [[nodiscard]] auto const& user_sources() const { return _user_sources; }
457 
458  private:
459  io_type _type = io_type::VOID;
460  std::vector<std::string> _filepaths;
461  std::vector<cudf::host_span<std::byte const>> _host_buffers;
462  std::vector<cudf::device_span<std::byte const>> _device_buffers;
463  std::vector<cudf::io::datasource*> _user_sources;
464 };
465 
469 struct sink_info {
470  sink_info() = default;
476  sink_info(size_t num_sinks) : _num_sinks(num_sinks) {}
477 
483  explicit sink_info(std::vector<std::string> const& file_paths)
484  : _type(io_type::FILEPATH), _num_sinks(file_paths.size()), _filepaths(file_paths)
485  {
486  }
487 
493  explicit sink_info(std::string const& file_path)
494  : _type(io_type::FILEPATH), _filepaths({file_path})
495  {
496  }
497 
503  explicit sink_info(std::vector<std::vector<char>*> const& buffers)
504  : _type(io_type::HOST_BUFFER), _num_sinks(buffers.size()), _buffers(buffers)
505  {
506  }
512  explicit sink_info(std::vector<char>* buffer) : _type(io_type::HOST_BUFFER), _buffers({buffer}) {}
513 
519  explicit sink_info(std::vector<cudf::io::data_sink*> const& user_sinks)
520  : _type(io_type::USER_IMPLEMENTED), _num_sinks(user_sinks.size()), _user_sinks(user_sinks)
521  {
522  }
523 
529  explicit sink_info(class cudf::io::data_sink* user_sink)
530  : _type(io_type::USER_IMPLEMENTED), _user_sinks({user_sink})
531  {
532  }
533 
539  [[nodiscard]] auto type() const { return _type; }
545  [[nodiscard]] auto num_sinks() const { return _num_sinks; }
551  [[nodiscard]] auto const& filepaths() const { return _filepaths; }
557  [[nodiscard]] auto const& buffers() const { return _buffers; }
563  [[nodiscard]] auto const& user_sinks() const { return _user_sinks; }
564 
565  private:
566  io_type _type = io_type::VOID;
567  size_t _num_sinks = 1;
568  std::vector<std::string> _filepaths;
569  std::vector<std::vector<char>*> _buffers;
570  std::vector<cudf::io::data_sink*> _user_sinks;
571 };
572 
573 class table_input_metadata;
574 
579  friend table_input_metadata;
580  std::string _name = "";
581  std::optional<bool> _nullable;
582  bool _list_column_is_map = false;
583  bool _use_int96_timestamp = false;
584  bool _output_as_binary = false;
585  std::optional<uint8_t> _decimal_precision;
586  std::optional<int32_t> _parquet_field_id;
587  std::vector<column_in_metadata> children;
588 
589  public:
590  column_in_metadata() = default;
596  column_in_metadata(std::string_view name) : _name{name} {}
604  {
605  children.push_back(child);
606  return *this;
607  }
608 
615  column_in_metadata& set_name(std::string const& name) noexcept
616  {
617  _name = name;
618  return *this;
619  }
620 
628  {
629  _nullable = nullable;
630  return *this;
631  }
632 
641  {
642  _list_column_is_map = true;
643  return *this;
644  }
645 
655  {
656  _use_int96_timestamp = req;
657  return *this;
658  }
659 
667  column_in_metadata& set_decimal_precision(uint8_t precision) noexcept
668  {
669  _decimal_precision = precision;
670  return *this;
671  }
672 
679  column_in_metadata& set_parquet_field_id(int32_t field_id) noexcept
680  {
681  _parquet_field_id = field_id;
682  return *this;
683  }
684 
694  {
695  _output_as_binary = binary;
696  if (_output_as_binary and children.size() == 1) {
697  children.emplace_back();
698  } else if (!_output_as_binary and children.size() == 2) {
699  children.pop_back();
700  }
701  return *this;
702  }
703 
710  column_in_metadata& child(size_type i) noexcept { return children[i]; }
711 
718  [[nodiscard]] column_in_metadata const& child(size_type i) const noexcept { return children[i]; }
719 
725  [[nodiscard]] std::string get_name() const noexcept { return _name; }
726 
732  [[nodiscard]] bool is_nullability_defined() const noexcept { return _nullable.has_value(); }
733 
741  [[nodiscard]] bool nullable() const { return _nullable.value(); }
742 
748  [[nodiscard]] bool is_map() const noexcept { return _list_column_is_map; }
749 
756  [[nodiscard]] bool is_enabled_int96_timestamps() const noexcept { return _use_int96_timestamp; }
757 
763  [[nodiscard]] bool is_decimal_precision_set() const noexcept
764  {
765  return _decimal_precision.has_value();
766  }
767 
775  [[nodiscard]] uint8_t get_decimal_precision() const { return _decimal_precision.value(); }
776 
782  [[nodiscard]] bool is_parquet_field_id_set() const noexcept
783  {
784  return _parquet_field_id.has_value();
785  }
786 
794  [[nodiscard]] int32_t get_parquet_field_id() const { return _parquet_field_id.value(); }
795 
801  [[nodiscard]] size_type num_children() const noexcept { return children.size(); }
802 
808  [[nodiscard]] bool is_enabled_output_as_binary() const noexcept { return _output_as_binary; }
809 };
810 
815  public:
816  table_input_metadata() = default; // Required by cython
817 
826 
835  explicit table_input_metadata(table_metadata const& metadata);
836 
837  std::vector<column_in_metadata> column_metadata;
838 };
839 
849 
850  partition_info() = default;
857  partition_info(size_type start_row, size_type num_rows) : start_row(start_row), num_rows(num_rows)
858  {
859  }
860 };
861 
867  // Whether to read binary data as a string column
868  bool _convert_binary_to_strings{true};
869 
870  std::vector<reader_column_schema> children;
871 
872  public:
873  reader_column_schema() = default;
874 
880  reader_column_schema(size_type number_of_children) { children.resize(number_of_children); }
881 
888  {
889  children.assign(child_span.begin(), child_span.end());
890  }
891 
899  {
900  children.push_back(child);
901  return *this;
902  }
903 
910  [[nodiscard]] reader_column_schema& child(size_type i) { return children[i]; }
911 
918  [[nodiscard]] reader_column_schema const& child(size_type i) const { return children[i]; }
919 
929  {
930  _convert_binary_to_strings = convert_to_string;
931  return *this;
932  }
933 
939  [[nodiscard]] bool is_enabled_convert_binary_to_strings() const
940  {
941  return _convert_binary_to_strings;
942  }
943 
949  [[nodiscard]] size_t get_num_children() const { return children.size(); }
950 };
951  // end of group
953 } // namespace io
954 } // namespace cudf
constexpr iterator end() const noexcept
Returns an iterator to the element following the last element of the span.
Definition: span.hpp:130
constexpr iterator begin() const noexcept
Returns an iterator to the first element of the span.
Definition: span.hpp:122
Metadata for a column.
Definition: io/types.hpp:578
column_in_metadata & set_name(std::string const &name) noexcept
Set the name of this column.
Definition: io/types.hpp:615
column_in_metadata & add_child(column_in_metadata const &child)
Add the children metadata of this column.
Definition: io/types.hpp:603
bool is_enabled_output_as_binary() const noexcept
Get whether to encode this column as binary or string data.
Definition: io/types.hpp:808
column_in_metadata & set_parquet_field_id(int32_t field_id) noexcept
Set the parquet field id of this column.
Definition: io/types.hpp:679
column_in_metadata & set_int96_timestamps(bool req) noexcept
Specifies whether this timestamp column should be encoded using the deprecated int96 physical type....
Definition: io/types.hpp:654
column_in_metadata & set_decimal_precision(uint8_t precision) noexcept
Set the decimal precision of this column. Only valid if this column is a decimal (fixed-point) type.
Definition: io/types.hpp:667
bool is_enabled_int96_timestamps() const noexcept
Get whether to encode this timestamp column using deprecated int96 physical type.
Definition: io/types.hpp:756
bool is_parquet_field_id_set() const noexcept
Get whether parquet field id has been set for this column.
Definition: io/types.hpp:782
bool is_decimal_precision_set() const noexcept
Get whether precision has been set for this decimal column.
Definition: io/types.hpp:763
bool nullable() const
Gets the explicitly set nullability for this column.
Definition: io/types.hpp:741
size_type num_children() const noexcept
Get the number of children of this column.
Definition: io/types.hpp:801
bool is_map() const noexcept
If this is the metadata of a list column, returns whether it is to be encoded as a map.
Definition: io/types.hpp:748
uint8_t get_decimal_precision() const
Get the decimal precision that was set for this column.
Definition: io/types.hpp:775
column_in_metadata & set_output_as_binary(bool binary) noexcept
Specifies whether this column should be written as binary or string data Only valid for the following...
Definition: io/types.hpp:693
column_in_metadata & child(size_type i) noexcept
Get reference to a child of this column.
Definition: io/types.hpp:710
int32_t get_parquet_field_id() const
Get the parquet field id that was set for this column.
Definition: io/types.hpp:794
std::string get_name() const noexcept
Get the name of this column.
Definition: io/types.hpp:725
column_in_metadata & set_list_column_as_map() noexcept
Specify that this list column should be encoded as a map in the written file.
Definition: io/types.hpp:640
column_in_metadata(std::string_view name)
Construct a new column in metadata object.
Definition: io/types.hpp:596
column_in_metadata & set_nullability(bool nullable) noexcept
Set the nullability of this column.
Definition: io/types.hpp:627
bool is_nullability_defined() const noexcept
Get whether nullability has been explicitly set for this column.
Definition: io/types.hpp:732
column_in_metadata const & child(size_type i) const noexcept
Get const reference to a child of this column.
Definition: io/types.hpp:718
Interface class for storing the output data from the writers.
Definition: data_sink.hpp:43
Interface class for providing input data to the readers.
Definition: datasource.hpp:41
schema element for reader
Definition: io/types.hpp:866
reader_column_schema const & child(size_type i) const
Get const reference to a child of this column.
Definition: io/types.hpp:918
bool is_enabled_convert_binary_to_strings() const
Get whether to encode this column as binary or string data.
Definition: io/types.hpp:939
reader_column_schema(host_span< reader_column_schema > const &child_span)
Construct a new reader column schema object with a span defining the children.
Definition: io/types.hpp:887
reader_column_schema & set_convert_binary_to_strings(bool convert_to_string)
Specifies whether this column should be written as binary or string data Only valid for the following...
Definition: io/types.hpp:928
size_t get_num_children() const
Get the number of child objects.
Definition: io/types.hpp:949
reader_column_schema & add_child(reader_column_schema const &child)
Add the children metadata of this column.
Definition: io/types.hpp:898
reader_column_schema & child(size_type i)
Get reference to a child of this column.
Definition: io/types.hpp:910
reader_column_schema(size_type number_of_children)
Construct a new reader column schema object.
Definition: io/types.hpp:880
Metadata for a table.
Definition: io/types.hpp:814
table_input_metadata(table_view const &table)
Construct a new table_input_metadata from a table_view.
table_input_metadata(table_metadata const &metadata)
Construct a new table_input_metadata from a table_metadata object.
std::vector< column_in_metadata > column_metadata
List of column metadata.
Definition: io/types.hpp:837
Statistics about compression performed by a writer.
Definition: io/types.hpp:105
auto compression_ratio() const noexcept
Returns the compression ratio for the successfully compressed blocks.
Definition: io/types.hpp:188
auto num_total_input_bytes() const noexcept
Returns the total size of compression inputs.
Definition: io/types.hpp:175
writer_compression_statistics & operator+=(writer_compression_statistics const &other) noexcept
Adds the values from another writer_compression_statistics object.
Definition: io/types.hpp:137
auto num_failed_bytes() const noexcept
Returns the number of bytes in blocks that failed to compress.
Definition: io/types.hpp:161
writer_compression_statistics()=default
Default constructor.
auto num_skipped_bytes() const noexcept
Returns the number of bytes in blocks that were skipped during compression.
Definition: io/types.hpp:168
writer_compression_statistics(size_t num_compressed_bytes, size_t num_failed_bytes, size_t num_skipped_bytes, size_t num_compressed_output_bytes)
Constructor with initial values.
Definition: io/types.hpp:120
auto num_compressed_bytes() const noexcept
Returns the number of bytes in blocks that were successfully compressed.
Definition: io/types.hpp:154
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:187
A set of cudf::column's of the same size.
Definition: table.hpp:40
io_type
Data source or destination types.
Definition: io/types.hpp:74
constexpr auto is_byte_like_type()
Returns true if the type is byte-like, meaning it is reasonable to pass as a pointer to bytes.
Definition: io/types.hpp:283
compression_type
Compression algorithms.
Definition: io/types.hpp:56
quote_style
Behavior when handling quotations in field data.
Definition: io/types.hpp:85
statistics_freq
Column statistics granularity type for parquet/orc writers.
Definition: io/types.hpp:95
dictionary_policy
Control use of dictionary encoding for parquet writer.
Definition: io/types.hpp:203
@ HOST_BUFFER
Input/output is a buffer in host memory.
@ USER_IMPLEMENTED
Input/output is handled by a custom user class.
@ VOID
Input/output is nothing. No work is done. Useful for benchmarking.
@ FILEPATH
Input/output is a file path.
@ DEVICE_BUFFER
Input/output is a buffer in device memory.
@ BROTLI
BROTLI format, using LZ77 + Huffman + 2nd order context modeling.
@ SNAPPY
Snappy format, using byte-oriented LZ77.
@ XZ
XZ format, using LZMA(2) algorithm.
@ ZIP
ZIP format, using DEFLATE algorithm.
@ LZO
Lempel–Ziv–Oberhumer format.
@ BZIP2
BZIP2 format, using Burrows-Wheeler transform.
@ ZSTD
Zstandard format.
@ ZLIB
ZLIB format, using DEFLATE algorithm.
@ LZ4
LZ4 format, using LZ77.
@ AUTO
Automatically detect or select compression format.
@ GZIP
GZIP format, using DEFLATE algorithm.
@ MINIMAL
Quote only fields which contain special characters.
@ ALL
Quote all fields.
@ NONE
Never quote fields; disable quotation parsing.
@ NONNUMERIC
Quote all non-numeric fields.
@ STATISTICS_COLUMN
Full column and offset indices. Implies STATISTICS_ROWGROUP.
Definition: io/types.hpp:99
@ STATISTICS_ROWGROUP
Per-Rowgroup column statistics.
Definition: io/types.hpp:97
@ STATISTICS_NONE
No column statistics.
Definition: io/types.hpp:96
@ STATISTICS_PAGE
Per-page column statistics.
Definition: io/types.hpp:98
@ ALWAYS
Use dictionary regardless of impact on compression.
Definition: io/types.hpp:206
@ ADAPTIVE
Use dictionary when it will not impact compression.
Definition: io/types.hpp:205
@ NEVER
Never use dictionary encoding.
Definition: io/types.hpp:204
std::unique_ptr< column > transform(column_view const &input, std::string const &unary_udf, data_type output_type, bool is_ptx, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Creates a new column by applying a unary function against every element of an input column.
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:93
cuDF interfaces
Definition: aggregation.hpp:34
bool nullable(table_view const &view)
Returns True if any of the columns in the table is nullable. (not entire hierarchy)
APIs for spans.
Device version of C++20 std::span with reduced feature set.
Definition: span.hpp:291
C++20 std::span with reduced feature set.
Definition: span.hpp:224
Detailed name (and optionally nullability) information for output columns.
Definition: io/types.hpp:215
std::optional< bool > is_nullable
Column nullability.
Definition: io/types.hpp:217
std::vector< column_name_info > children
Child column names.
Definition: io/types.hpp:218
column_name_info(std::string const &_name, std::optional< bool > _is_nullable=std::nullopt)
Construct a column name info with a name, optional nullabilty, and no children.
Definition: io/types.hpp:226
std::string name
Column name.
Definition: io/types.hpp:216
Non-owning view of a host memory buffer.
Definition: io/types.hpp:261
char const * data
Pointer to the buffer.
Definition: io/types.hpp:263
size_t size
Size of the buffer.
Definition: io/types.hpp:264
host_buffer(char const *data, size_t size)
Construct a new host buffer object.
Definition: io/types.hpp:272
Information used while writing partitioned datasets.
Definition: io/types.hpp:846
partition_info(size_type start_row, size_type num_rows)
Construct a new partition_info.
Definition: io/types.hpp:857
size_type start_row
The start row of the partition.
Definition: io/types.hpp:847
size_type num_rows
The number of rows in the partition.
Definition: io/types.hpp:848
Destination information for write interfaces.
Definition: io/types.hpp:469
auto const & buffers() const
Get the host buffers of the input.
Definition: io/types.hpp:557
sink_info(std::vector< std::vector< char > * > const &buffers)
Construct a new sink info object for multiple host buffers.
Definition: io/types.hpp:503
sink_info(std::string const &file_path)
Construct a new sink info object for a single file.
Definition: io/types.hpp:493
auto const & filepaths() const
Get the filepaths of the input.
Definition: io/types.hpp:551
sink_info(class cudf::io::data_sink *user_sink)
Construct a new sink info object for a single user-implemented sink.
Definition: io/types.hpp:529
sink_info(std::vector< cudf::io::data_sink * > const &user_sinks)
Construct a new sink info object for multiple user-implemented sinks.
Definition: io/types.hpp:519
auto num_sinks() const
Get the number of sinks.
Definition: io/types.hpp:545
auto const & user_sinks() const
Get the user sinks of the input.
Definition: io/types.hpp:563
sink_info(std::vector< std::string > const &file_paths)
Construct a new sink info object for multiple files.
Definition: io/types.hpp:483
sink_info(size_t num_sinks)
Construct a new sink info object.
Definition: io/types.hpp:476
auto type() const
Get the type of the input.
Definition: io/types.hpp:539
sink_info(std::vector< char > *buffer)
Construct a new sink info object for a single host buffer.
Definition: io/types.hpp:512
Source information for read interfaces.
Definition: io/types.hpp:294
auto const & device_buffers() const
Get the device buffers of the input.
Definition: io/types.hpp:450
source_info(char const *host_data, size_t size)
Construct a new source info object for a single buffer.
Definition: io/types.hpp:344
auto const & filepaths() const
Get the filepaths of the input.
Definition: io/types.hpp:438
source_info(cudf::host_span< T > host_data)
Construct a new source info object for a single buffer.
Definition: io/types.hpp:380
source_info(std::string const &file_path)
Construct a new source info object for a single file.
Definition: io/types.hpp:312
source_info(cudf::host_span< cudf::host_span< T >> const host_buffers)
Construct a new source info object for multiple buffers in host memory.
Definition: io/types.hpp:357
source_info(cudf::device_span< std::byte const > d_buffer)
Construct a new source info object from a device buffer.
Definition: io/types.hpp:402
source_info(cudf::io::datasource *source)
Construct a new source info object for a single user-implemented source.
Definition: io/types.hpp:422
source_info(std::vector< cudf::io::datasource * > const &sources)
Construct a new source info object for multiple user-implemented sources.
Definition: io/types.hpp:412
source_info(cudf::host_span< cudf::device_span< std::byte const >> device_buffers)
Construct a new source info object for multiple buffers in device memory.
Definition: io/types.hpp:392
auto const & host_buffers() const
Get the host buffers of the input.
Definition: io/types.hpp:444
auto type() const
Get the type of the input.
Definition: io/types.hpp:432
source_info(std::vector< std::string > const &file_paths)
Construct a new source info object for multiple files.
Definition: io/types.hpp:302
auto const & user_sources() const
Get the user sources of the input.
Definition: io/types.hpp:456
source_info(std::vector< host_buffer > const &host_buffers)
Construct a new source info object for multiple buffers in host memory.
Definition: io/types.hpp:324
Table metadata returned by IO readers.
Definition: io/types.hpp:237
std::vector< std::unordered_map< std::string, std::string > > per_file_user_data
Per file format-dependent metadata as key-values pairs.
Definition: io/types.hpp:243
std::vector< column_name_info > schema_info
Detailed name information for the entire output hierarchy.
Definition: io/types.hpp:239
std::map< std::string, std::string > user_data
Definition: io/types.hpp:240
Table with table metadata used by io readers to return the metadata by value.
Definition: io/types.hpp:249
std::unique_ptr< table > tbl
Table.
Definition: io/types.hpp:250
table_metadata metadata
Table metadata.
Definition: io/types.hpp:251
Class definition for cudf::table.
Type declarations for libcudf.