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 
105 enum class column_encoding {
106  // Common encodings:
107  USE_DEFAULT = -1,
108  DICTIONARY,
109  // Parquet encodings:
110  PLAIN,
116  // ORC encodings:
117  DIRECT,
118  DIRECT_V2,
119  DICTIONARY_V2,
120 };
121 
126  public:
131 
141  size_t num_failed_bytes,
142  size_t num_skipped_bytes,
143  size_t num_compressed_output_bytes)
144  : _num_compressed_bytes(num_compressed_bytes),
145  _num_failed_bytes(num_failed_bytes),
146  _num_skipped_bytes(num_skipped_bytes),
147  _num_compressed_output_bytes(num_compressed_output_bytes)
148  {
149  }
150 
158  {
159  _num_compressed_bytes += other._num_compressed_bytes;
160  _num_failed_bytes += other._num_failed_bytes;
161  _num_skipped_bytes += other._num_skipped_bytes;
162  _num_compressed_output_bytes += other._num_compressed_output_bytes;
163  return *this;
164  }
165 
174  [[nodiscard]] auto num_compressed_bytes() const noexcept { return _num_compressed_bytes; }
175 
181  [[nodiscard]] auto num_failed_bytes() const noexcept { return _num_failed_bytes; }
182 
188  [[nodiscard]] auto num_skipped_bytes() const noexcept { return _num_skipped_bytes; }
189 
195  [[nodiscard]] auto num_total_input_bytes() const noexcept
196  {
198  }
199 
208  [[nodiscard]] auto compression_ratio() const noexcept
209  {
210  return static_cast<double>(num_compressed_bytes()) / _num_compressed_output_bytes;
211  }
212 
213  private:
214  std::size_t _num_compressed_bytes = 0;
215  std::size_t _num_failed_bytes = 0;
216  std::size_t _num_skipped_bytes = 0;
217  std::size_t _num_compressed_output_bytes = 0;
218 };
219 
224  NEVER = 0,
225  ADAPTIVE = 1,
226  ALWAYS = 2
227 };
228 
236  std::string name;
237  std::optional<bool> is_nullable;
238  std::vector<column_name_info> children;
239 
246  column_name_info(std::string const& _name, std::optional<bool> _is_nullable = std::nullopt)
247  : name(_name), is_nullable(_is_nullable)
248  {
249  }
250 
251  column_name_info() = default;
252 };
253 
258  std::vector<column_name_info>
260  std::map<std::string, std::string> user_data;
262  std::vector<std::unordered_map<std::string, std::string>>
264 };
265 
270  std::unique_ptr<table> tbl;
272 };
273 
281 struct host_buffer {
282  // TODO: to be replaced by `host_span`
283  char const* data = nullptr;
284  size_t size = 0;
285  host_buffer() = default;
292  host_buffer(char const* data, size_t size) : data(data), size(size) {}
293 };
294 
302 template <typename T>
303 constexpr inline auto is_byte_like_type()
304 {
305  using non_cv_T = std::remove_cv_t<T>;
306  return std::is_same_v<non_cv_T, int8_t> || std::is_same_v<non_cv_T, char> ||
307  std::is_same_v<non_cv_T, uint8_t> || std::is_same_v<non_cv_T, unsigned char> ||
308  std::is_same_v<non_cv_T, std::byte>;
309 }
310 
314 struct source_info {
315  source_info() = default;
316 
322  explicit source_info(std::vector<std::string> const& file_paths)
323  : _type(io_type::FILEPATH), _filepaths(file_paths)
324  {
325  }
326 
332  explicit source_info(std::string const& file_path)
333  : _type(io_type::FILEPATH), _filepaths({file_path})
334  {
335  }
336 
344  explicit source_info(std::vector<host_buffer> const& host_buffers) : _type(io_type::HOST_BUFFER)
345  {
346  _host_buffers.reserve(host_buffers.size());
348  host_buffers.end(),
349  std::back_inserter(_host_buffers),
350  [](auto const hb) {
351  return cudf::host_span<std::byte const>{
352  reinterpret_cast<std::byte const*>(hb.data), hb.size};
353  });
354  }
355 
364  explicit source_info(char const* host_data, size_t size)
365  : _type(io_type::HOST_BUFFER),
366  _host_buffers(
367  {cudf::host_span<std::byte const>(reinterpret_cast<std::byte const*>(host_data), size)})
368  {
369  }
370 
376  template <typename T, CUDF_ENABLE_IF(is_byte_like_type<std::remove_cv_t<T>>())>
377  explicit source_info(cudf::host_span<cudf::host_span<T>> const host_buffers)
378  : _type(io_type::HOST_BUFFER)
379  {
380  if constexpr (not std::is_same_v<std::remove_cv_t<T>, std::byte>) {
381  _host_buffers.reserve(host_buffers.size());
382  std::transform(host_buffers.begin(),
383  host_buffers.end(),
384  std::back_inserter(_host_buffers),
385  [](auto const s) {
386  return cudf::host_span<std::byte const>{
387  reinterpret_cast<std::byte const*>(s.data()), s.size()};
388  });
389  } else {
390  _host_buffers.assign(host_buffers.begin(), host_buffers.end());
391  }
392  }
393 
399  template <typename T, CUDF_ENABLE_IF(is_byte_like_type<std::remove_cv_t<T>>())>
400  explicit source_info(cudf::host_span<T> host_data)
401  : _type(io_type::HOST_BUFFER),
402  _host_buffers{cudf::host_span<std::byte const>(
403  reinterpret_cast<std::byte const*>(host_data.data()), host_data.size())}
404  {
405  }
406 
413  : _type(io_type::DEVICE_BUFFER), _device_buffers(device_buffers.begin(), device_buffers.end())
414  {
415  }
416 
423  : _type(io_type::DEVICE_BUFFER), _device_buffers({{d_buffer}})
424  {
425  }
426 
432  explicit source_info(std::vector<cudf::io::datasource*> const& sources)
433  : _type(io_type::USER_IMPLEMENTED), _user_sources(sources)
434  {
435  }
436 
443  : _type(io_type::USER_IMPLEMENTED), _user_sources({source})
444  {
445  }
446 
452  [[nodiscard]] auto type() const { return _type; }
458  [[nodiscard]] auto const& filepaths() const { return _filepaths; }
464  [[nodiscard]] auto const& host_buffers() const { return _host_buffers; }
470  [[nodiscard]] auto const& device_buffers() const { return _device_buffers; }
476  [[nodiscard]] auto const& user_sources() const { return _user_sources; }
477 
478  private:
479  io_type _type = io_type::VOID;
480  std::vector<std::string> _filepaths;
481  std::vector<cudf::host_span<std::byte const>> _host_buffers;
482  std::vector<cudf::device_span<std::byte const>> _device_buffers;
483  std::vector<cudf::io::datasource*> _user_sources;
484 };
485 
489 struct sink_info {
490  sink_info() = default;
496  sink_info(size_t num_sinks) : _num_sinks(num_sinks) {}
497 
503  explicit sink_info(std::vector<std::string> const& file_paths)
504  : _type(io_type::FILEPATH), _num_sinks(file_paths.size()), _filepaths(file_paths)
505  {
506  }
507 
513  explicit sink_info(std::string const& file_path)
514  : _type(io_type::FILEPATH), _filepaths({file_path})
515  {
516  }
517 
523  explicit sink_info(std::vector<std::vector<char>*> const& buffers)
524  : _type(io_type::HOST_BUFFER), _num_sinks(buffers.size()), _buffers(buffers)
525  {
526  }
532  explicit sink_info(std::vector<char>* buffer) : _type(io_type::HOST_BUFFER), _buffers({buffer}) {}
533 
539  explicit sink_info(std::vector<cudf::io::data_sink*> const& user_sinks)
540  : _type(io_type::USER_IMPLEMENTED), _num_sinks(user_sinks.size()), _user_sinks(user_sinks)
541  {
542  }
543 
549  explicit sink_info(class cudf::io::data_sink* user_sink)
550  : _type(io_type::USER_IMPLEMENTED), _user_sinks({user_sink})
551  {
552  }
553 
559  [[nodiscard]] auto type() const { return _type; }
565  [[nodiscard]] auto num_sinks() const { return _num_sinks; }
571  [[nodiscard]] auto const& filepaths() const { return _filepaths; }
577  [[nodiscard]] auto const& buffers() const { return _buffers; }
583  [[nodiscard]] auto const& user_sinks() const { return _user_sinks; }
584 
585  private:
586  io_type _type = io_type::VOID;
587  size_t _num_sinks = 1;
588  std::vector<std::string> _filepaths;
589  std::vector<std::vector<char>*> _buffers;
590  std::vector<cudf::io::data_sink*> _user_sinks;
591 };
592 
593 class table_input_metadata;
594 
599  friend table_input_metadata;
600  std::string _name = "";
601  std::optional<bool> _nullable;
602  bool _list_column_is_map = false;
603  bool _use_int96_timestamp = false;
604  bool _output_as_binary = false;
605  std::optional<uint8_t> _decimal_precision;
606  std::optional<int32_t> _parquet_field_id;
607  std::vector<column_in_metadata> children;
608  column_encoding _encoding = column_encoding::USE_DEFAULT;
609 
610  public:
611  column_in_metadata() = default;
617  column_in_metadata(std::string_view name) : _name{name} {}
625  {
626  children.push_back(child);
627  return *this;
628  }
629 
636  column_in_metadata& set_name(std::string const& name) noexcept
637  {
638  _name = name;
639  return *this;
640  }
641 
649  {
650  _nullable = nullable;
651  return *this;
652  }
653 
662  {
663  _list_column_is_map = true;
664  return *this;
665  }
666 
676  {
677  _use_int96_timestamp = req;
678  return *this;
679  }
680 
688  column_in_metadata& set_decimal_precision(uint8_t precision) noexcept
689  {
690  _decimal_precision = precision;
691  return *this;
692  }
693 
700  column_in_metadata& set_parquet_field_id(int32_t field_id) noexcept
701  {
702  _parquet_field_id = field_id;
703  return *this;
704  }
705 
715  {
716  _output_as_binary = binary;
717  if (_output_as_binary and children.size() == 1) {
718  children.emplace_back();
719  } else if (!_output_as_binary and children.size() == 2) {
720  children.pop_back();
721  }
722  return *this;
723  }
724 
736  {
737  _encoding = encoding;
738  return *this;
739  }
740 
747  column_in_metadata& child(size_type i) noexcept { return children[i]; }
748 
755  [[nodiscard]] column_in_metadata const& child(size_type i) const noexcept { return children[i]; }
756 
762  [[nodiscard]] std::string get_name() const noexcept { return _name; }
763 
769  [[nodiscard]] bool is_nullability_defined() const noexcept { return _nullable.has_value(); }
770 
778  [[nodiscard]] bool nullable() const { return _nullable.value(); }
779 
785  [[nodiscard]] bool is_map() const noexcept { return _list_column_is_map; }
786 
793  [[nodiscard]] bool is_enabled_int96_timestamps() const noexcept { return _use_int96_timestamp; }
794 
800  [[nodiscard]] bool is_decimal_precision_set() const noexcept
801  {
802  return _decimal_precision.has_value();
803  }
804 
812  [[nodiscard]] uint8_t get_decimal_precision() const { return _decimal_precision.value(); }
813 
819  [[nodiscard]] bool is_parquet_field_id_set() const noexcept
820  {
821  return _parquet_field_id.has_value();
822  }
823 
831  [[nodiscard]] int32_t get_parquet_field_id() const { return _parquet_field_id.value(); }
832 
838  [[nodiscard]] size_type num_children() const noexcept { return children.size(); }
839 
845  [[nodiscard]] bool is_enabled_output_as_binary() const noexcept { return _output_as_binary; }
846 
852  [[nodiscard]] column_encoding get_encoding() const { return _encoding; }
853 };
854 
859  public:
860  table_input_metadata() = default; // Required by cython
861 
870 
879  explicit table_input_metadata(table_metadata const& metadata);
880 
881  std::vector<column_in_metadata> column_metadata;
882 };
883 
893 
894  partition_info() = default;
901  partition_info(size_type start_row, size_type num_rows) : start_row(start_row), num_rows(num_rows)
902  {
903  }
904 };
905 
911  // Whether to read binary data as a string column
912  bool _convert_binary_to_strings{true};
913 
914  std::vector<reader_column_schema> children;
915 
916  public:
917  reader_column_schema() = default;
918 
924  reader_column_schema(size_type number_of_children) { children.resize(number_of_children); }
925 
932  {
933  children.assign(child_span.begin(), child_span.end());
934  }
935 
943  {
944  children.push_back(child);
945  return *this;
946  }
947 
954  [[nodiscard]] reader_column_schema& child(size_type i) { return children[i]; }
955 
962  [[nodiscard]] reader_column_schema const& child(size_type i) const { return children[i]; }
963 
973  {
974  _convert_binary_to_strings = convert_to_string;
975  return *this;
976  }
977 
983  [[nodiscard]] bool is_enabled_convert_binary_to_strings() const
984  {
985  return _convert_binary_to_strings;
986  }
987 
993  [[nodiscard]] size_t get_num_children() const { return children.size(); }
994 };
995  // end of group
997 } // namespace io
998 } // 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:598
column_in_metadata & set_name(std::string const &name) noexcept
Set the name of this column.
Definition: io/types.hpp:636
column_in_metadata & add_child(column_in_metadata const &child)
Add the children metadata of this column.
Definition: io/types.hpp:624
bool is_enabled_output_as_binary() const noexcept
Get whether to encode this column as binary or string data.
Definition: io/types.hpp:845
column_in_metadata & set_parquet_field_id(int32_t field_id) noexcept
Set the parquet field id of this column.
Definition: io/types.hpp:700
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:675
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:688
bool is_enabled_int96_timestamps() const noexcept
Get whether to encode this timestamp column using deprecated int96 physical type.
Definition: io/types.hpp:793
bool is_parquet_field_id_set() const noexcept
Get whether parquet field id has been set for this column.
Definition: io/types.hpp:819
bool is_decimal_precision_set() const noexcept
Get whether precision has been set for this decimal column.
Definition: io/types.hpp:800
bool nullable() const
Gets the explicitly set nullability for this column.
Definition: io/types.hpp:778
size_type num_children() const noexcept
Get the number of children of this column.
Definition: io/types.hpp:838
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:785
uint8_t get_decimal_precision() const
Get the decimal precision that was set for this column.
Definition: io/types.hpp:812
column_in_metadata & set_encoding(column_encoding encoding) noexcept
Sets the encoding to use for this column.
Definition: io/types.hpp:735
column_encoding get_encoding() const
Get the encoding that was set for this column.
Definition: io/types.hpp:852
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:714
column_in_metadata & child(size_type i) noexcept
Get reference to a child of this column.
Definition: io/types.hpp:747
int32_t get_parquet_field_id() const
Get the parquet field id that was set for this column.
Definition: io/types.hpp:831
std::string get_name() const noexcept
Get the name of this column.
Definition: io/types.hpp:762
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:661
column_in_metadata(std::string_view name)
Construct a new column in metadata object.
Definition: io/types.hpp:617
column_in_metadata & set_nullability(bool nullable) noexcept
Set the nullability of this column.
Definition: io/types.hpp:648
bool is_nullability_defined() const noexcept
Get whether nullability has been explicitly set for this column.
Definition: io/types.hpp:769
column_in_metadata const & child(size_type i) const noexcept
Get const reference to a child of this column.
Definition: io/types.hpp:755
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:910
reader_column_schema const & child(size_type i) const
Get const reference to a child of this column.
Definition: io/types.hpp:962
bool is_enabled_convert_binary_to_strings() const
Get whether to encode this column as binary or string data.
Definition: io/types.hpp:983
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:931
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:972
size_t get_num_children() const
Get the number of child objects.
Definition: io/types.hpp:993
reader_column_schema & add_child(reader_column_schema const &child)
Add the children metadata of this column.
Definition: io/types.hpp:942
reader_column_schema & child(size_type i)
Get reference to a child of this column.
Definition: io/types.hpp:954
reader_column_schema(size_type number_of_children)
Construct a new reader column schema object.
Definition: io/types.hpp:924
Metadata for a table.
Definition: io/types.hpp:858
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:881
Statistics about compression performed by a writer.
Definition: io/types.hpp:125
auto compression_ratio() const noexcept
Returns the compression ratio for the successfully compressed blocks.
Definition: io/types.hpp:208
auto num_total_input_bytes() const noexcept
Returns the total size of compression inputs.
Definition: io/types.hpp:195
writer_compression_statistics & operator+=(writer_compression_statistics const &other) noexcept
Adds the values from another writer_compression_statistics object.
Definition: io/types.hpp:157
auto num_failed_bytes() const noexcept
Returns the number of bytes in blocks that failed to compress.
Definition: io/types.hpp:181
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:188
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:140
auto num_compressed_bytes() const noexcept
Returns the number of bytes in blocks that were successfully compressed.
Definition: io/types.hpp:174
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:303
compression_type
Compression algorithms.
Definition: io/types.hpp:56
quote_style
Behavior when handling quotations in field data.
Definition: io/types.hpp:85
column_encoding
Valid encodings for use with column_in_metadata::set_encoding()
Definition: io/types.hpp:105
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:223
@ 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.
@ DELTA_BINARY_PACKED
Use DELTA_BINARY_PACKED encoding (only valid for integer columns)
@ DIRECT
Use DIRECT encoding.
@ DIRECT_V2
Use DIRECT_V2 encoding.
@ DICTIONARY
Use dictionary encoding.
@ USE_DEFAULT
No encoding has been requested, use default encoding.
@ DICTIONARY_V2
Use DICTIONARY_V2 encoding.
@ PLAIN
Use plain encoding.
@ 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:226
@ ADAPTIVE
Use dictionary when it will not impact compression.
Definition: io/types.hpp:225
@ NEVER
Never use dictionary encoding.
Definition: io/types.hpp:224
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:235
std::optional< bool > is_nullable
Column nullability.
Definition: io/types.hpp:237
std::vector< column_name_info > children
Child column names.
Definition: io/types.hpp:238
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:246
std::string name
Column name.
Definition: io/types.hpp:236
Non-owning view of a host memory buffer.
Definition: io/types.hpp:281
char const * data
Pointer to the buffer.
Definition: io/types.hpp:283
size_t size
Size of the buffer.
Definition: io/types.hpp:284
host_buffer(char const *data, size_t size)
Construct a new host buffer object.
Definition: io/types.hpp:292
Information used while writing partitioned datasets.
Definition: io/types.hpp:890
partition_info(size_type start_row, size_type num_rows)
Construct a new partition_info.
Definition: io/types.hpp:901
size_type start_row
The start row of the partition.
Definition: io/types.hpp:891
size_type num_rows
The number of rows in the partition.
Definition: io/types.hpp:892
Destination information for write interfaces.
Definition: io/types.hpp:489
auto const & buffers() const
Get the host buffers of the input.
Definition: io/types.hpp:577
sink_info(std::vector< std::vector< char > * > const &buffers)
Construct a new sink info object for multiple host buffers.
Definition: io/types.hpp:523
sink_info(std::string const &file_path)
Construct a new sink info object for a single file.
Definition: io/types.hpp:513
auto const & filepaths() const
Get the filepaths of the input.
Definition: io/types.hpp:571
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:549
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:539
auto num_sinks() const
Get the number of sinks.
Definition: io/types.hpp:565
auto const & user_sinks() const
Get the user sinks of the input.
Definition: io/types.hpp:583
sink_info(std::vector< std::string > const &file_paths)
Construct a new sink info object for multiple files.
Definition: io/types.hpp:503
sink_info(size_t num_sinks)
Construct a new sink info object.
Definition: io/types.hpp:496
auto type() const
Get the type of the input.
Definition: io/types.hpp:559
sink_info(std::vector< char > *buffer)
Construct a new sink info object for a single host buffer.
Definition: io/types.hpp:532
Source information for read interfaces.
Definition: io/types.hpp:314
auto const & device_buffers() const
Get the device buffers of the input.
Definition: io/types.hpp:470
source_info(char const *host_data, size_t size)
Construct a new source info object for a single buffer.
Definition: io/types.hpp:364
auto const & filepaths() const
Get the filepaths of the input.
Definition: io/types.hpp:458
source_info(cudf::host_span< T > host_data)
Construct a new source info object for a single buffer.
Definition: io/types.hpp:400
source_info(std::string const &file_path)
Construct a new source info object for a single file.
Definition: io/types.hpp:332
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:377
source_info(cudf::device_span< std::byte const > d_buffer)
Construct a new source info object from a device buffer.
Definition: io/types.hpp:422
source_info(cudf::io::datasource *source)
Construct a new source info object for a single user-implemented source.
Definition: io/types.hpp:442
source_info(std::vector< cudf::io::datasource * > const &sources)
Construct a new source info object for multiple user-implemented sources.
Definition: io/types.hpp:432
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:412
auto const & host_buffers() const
Get the host buffers of the input.
Definition: io/types.hpp:464
auto type() const
Get the type of the input.
Definition: io/types.hpp:452
source_info(std::vector< std::string > const &file_paths)
Construct a new source info object for multiple files.
Definition: io/types.hpp:322
auto const & user_sources() const
Get the user sources of the input.
Definition: io/types.hpp:476
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:344
Table metadata returned by IO readers.
Definition: io/types.hpp:257
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:263
std::vector< column_name_info > schema_info
Detailed name information for the entire output hierarchy.
Definition: io/types.hpp:259
std::map< std::string, std::string > user_data
Definition: io/types.hpp:260
Table with table metadata used by io readers to return the metadata by value.
Definition: io/types.hpp:269
std::unique_ptr< table > tbl
Table.
Definition: io/types.hpp:270
table_metadata metadata
Table metadata.
Definition: io/types.hpp:271
Class definition for cudf::table.
Type declarations for libcudf.