32 #include <unordered_map>
36 namespace CUDF_EXPORT
cudf {
45 namespace CUDF_EXPORT
cudf {
151 size_t num_failed_bytes,
152 size_t num_skipped_bytes,
167 _num_compressed_bytes += other._num_compressed_bytes;
216 std::size_t _num_compressed_bytes = 0;
217 std::size_t _num_failed_bytes = 0;
218 std::size_t _num_skipped_bytes = 0;
219 std::size_t _num_compressed_output_bytes = 0;
290 std::optional<size_type>
294 std::optional<size_type>
339 using non_cv_T = std::remove_cv_t<T>;
340 return std::is_same_v<non_cv_T, int8_t> || std::is_same_v<non_cv_T, char> ||
341 std::is_same_v<non_cv_T, uint8_t> || std::is_same_v<non_cv_T, unsigned char> ||
342 std::is_same_v<non_cv_T, std::byte>;
385 _host_buffers.reserve(host_buffers.size());
388 std::back_inserter(_host_buffers),
404 explicit source_info(
char const* host_data,
size_t size)
419 if constexpr (not std::is_same_v<std::remove_cv_t<T>, std::byte>) {
420 _host_buffers.reserve(host_buffers.size());
423 std::back_inserter(_host_buffers),
425 return cudf::host_span<std::byte const>{
426 reinterpret_cast<std::byte const*>(s.data()), s.size()};
515 std::vector<std::string> _filepaths;
516 std::vector<cudf::host_span<std::byte const>> _host_buffers;
517 std::vector<cudf::device_span<std::byte const>> _device_buffers;
518 std::vector<cudf::io::datasource*> _user_sources;
579 _num_sinks(user_sinks.size()),
624 size_t _num_sinks = 1;
625 std::vector<std::string> _filepaths;
626 std::vector<std::vector<char>*> _buffers;
627 std::vector<cudf::io::data_sink*> _user_sinks;
630 class table_input_metadata;
637 std::optional<bool> _nullable;
638 bool _list_column_is_map =
false;
639 bool _use_int96_timestamp =
false;
640 bool _output_as_binary =
false;
641 bool _skip_compression =
false;
642 std::optional<uint8_t> _decimal_precision;
643 std::optional<int32_t> _parquet_field_id;
644 std::optional<int32_t> _type_length;
645 std::vector<column_in_metadata> children;
772 _output_as_binary = binary;
773 if (_output_as_binary and children.size() == 1) {
774 children.emplace_back();
775 }
else if (!_output_as_binary and children.size() == 2) {
826 [[nodiscard]] std::string
const&
get_name() const noexcept {
return _name; }
842 [[nodiscard]]
bool nullable()
const {
return _nullable.value(); }
849 [[nodiscard]]
bool is_map() const noexcept {
return _list_column_is_map; }
866 return _decimal_precision.has_value();
901 return _parquet_field_id.has_value();
999 bool _convert_binary_to_strings{
true};
1000 int32_t _type_length{0};
1002 std::vector<reader_column_schema> children;
1021 children.assign(child_span.
begin(), child_span.
end());
1032 children.push_back(child);
1062 _convert_binary_to_strings = convert_to_string;
1074 _type_length = type_length;
1085 return _convert_binary_to_strings;
constexpr CUDF_HOST_DEVICE iterator end() const noexcept
返回指向 span 中最后一个元素之后元素的迭代器。
constexpr CUDF_HOST_DEVICE iterator begin() const noexcept
返回指向 span 中第一个元素的迭代器。
reader_column_schema const & child(size_type i) const
获取此列子项的 const 引用。
reader_column_schema & set_type_length(int32_t type_length)
设置固定长度数据的长度。
bool is_enabled_convert_binary_to_strings() const
获取此列是否编码为二进制或字符串数据。
int32_t get_type_length() const
获取此固定长度数据的字节长度。
reader_column_schema(host_span< reader_column_schema > const &child_span)
构造一个包含定义子项的 span 的新 reader 列 schema 对象。
reader_column_schema & set_convert_binary_to_strings(bool convert_to_string)
指定此列应写为二进制还是字符串数据。仅对以下类型有效...
size_t get_num_children() const
获取子对象的数量。
reader_column_schema & add_child(reader_column_schema const &child)
添加此列的子元数据。
reader_column_schema & child(size_type i)
获取此列子项的引用。
reader_column_schema(size_type number_of_children)
构造一个新的 reader 列 schema 对象。
auto compression_ratio() const noexcept
返回成功压缩块的压缩比。
auto num_total_input_bytes() const noexcept
返回压缩输入的总大小。
writer_compression_statistics & operator+=(writer_compression_statistics const &other) noexcept
添加另一个 writer_compression_statistics 对象的值。
auto num_failed_bytes() const noexcept
返回压缩失败块中的字节数。
writer_compression_statistics()=default
默认构造函数。
auto num_skipped_bytes() const noexcept
返回压缩过程中跳过块中的字节数。
writer_compression_statistics(size_t num_compressed_bytes, size_t num_failed_bytes, size_t num_skipped_bytes, size_t num_compressed_output_bytes)
带初始值的构造函数。
auto num_compressed_bytes() const noexcept
返回成功压缩块中的字节数。
一组相同大小的 cudf::column_view。
statistics_freq
parquet/orc writer 的列统计信息粒度类型。
column_encoding
可与 column_in_metadata::set_encoding() 一起使用的有效编码。
quote_style
处理字段数据中的引号时的行为。
constexpr auto is_byte_like_type()
如果类型是字节类(即合理地可以作为字节指针传递),则返回 true。
dictionary_policy
控制 parquet writer 使用字典编码。
@ STATISTICS_COLUMN
完整的列和偏移量索引。意味着 STATISTICS_ROWGROUP。
@ STATISTICS_ROWGROUP
每行组列统计信息。
@ STATISTICS_PAGE
每页列统计信息。
@ DELTA_BINARY_PACKED
使用 DELTA_BINARY_PACKED 编码(仅对整数列有效)
@ USE_DEFAULT
未请求编码,使用默认编码。
@ DELTA_LENGTH_BYTE_ARRAY
@ BYTE_STREAM_SPLIT
使用 BYTE_STREAM_SPLIT 编码(对所有固定宽度类型有效)
@ ALWAYS
无论对压缩的影响如何,都使用字典。
@ ADAPTIVE
在不影响压缩的情况下使用字典。
@ BROTLI
BROTLI 格式,使用 LZ77 + Huffman + 二阶上下文建模。
@ ZIP
ZIP 格式,使用 DEFLATE 算法。
@ BZIP2
BZIP2 格式,使用 Burrows-Wheeler 变换。
@ HOST_BUFFER
输入/输出是主机内存中的缓冲区。
@ USER_IMPLEMENTED
输入/输出由自定义用户类处理。
@ VOID
无输入/输出。不执行任何工作。适用于基准测试。
@ DEVICE_BUFFER
输入/输出是设备内存中的缓冲区。
int32_t size_type
列和表的行索引类型。
bool nullable(table_view const &view)
如果表中的任何列是可空的(而不是整个层级结构),则返回 True。
C++20 std::span 的设备版本,功能集有所减少。
std::optional< bool > is_nullable
列的可空性。
std::optional< bool > is_binary
列是二进制的(即不是列表)
std::vector< column_name_info > children
子列名称。
bool operator==(column_name_info const &rhs) const
比较两个列名称信息结构是否相等。
std::optional< int32_t > type_length
数据字节宽度(针对固定长度数据)
column_name_info(std::string _name, std::optional< bool > _is_nullable=std::nullopt, std::optional< bool > _is_binary=std::nullopt)
构造一个带有名称、可选可空性且无子项的列名称信息。
host_buffer(char const *data, size_t size)
构造一个新的主机缓冲区对象。
partition_info(size_type start_row, size_type num_rows)
构造一个新的 partition_info。
size_type start_row
分区的起始行。
size_type num_rows
分区中的行数。
auto const & buffers() const
获取输入的宿主缓冲区。
sink_info(std::vector< std::vector< char > * > buffers)
为多个宿主缓冲区构造新的 sink info 对象。
auto const & filepaths() const
获取输入的的文件路径。
sink_info(std::string file_path)
为单个文件构造新的 sink info 对象。
sink_info(class cudf::io::data_sink *user_sink)
为单个用户实现的 sink 构造新的 sink info 对象。
sink_info(std::vector< cudf::io::data_sink * > const &user_sinks)
为多个用户实现的 sink 构造新的 sink info 对象。
auto num_sinks() const
获取 sink 的数量。
auto const & user_sinks() const
获取输入的的用户 sink。
sink_info(size_t num_sinks)
构造新的 sink info 对象。
auto type() const
获取输入的类型。
sink_info(std::vector< char > *buffer)
为单个宿主缓冲区构造新的 sink info 对象。
sink_info(std::vector< std::string > file_paths)
为多个文件构造新的 sink info 对象。
auto const & device_buffers() const
获取输入的设备缓冲区。
source_info(char const *host_data, size_t size)
为单个缓冲区构造新的 source info 对象。
source_info(std::vector< std::string > file_paths)
为多个文件构造新的 source info 对象。
auto const & filepaths() const
获取输入的的文件路径。
source_info(cudf::host_span< T > host_data)
为单个缓冲区构造新的 source info 对象。
source_info(cudf::host_span< cudf::host_span< T >> const host_buffers)
为宿主内存中的多个缓冲区构造新的 source info 对象。
source_info(cudf::device_span< std::byte const > d_buffer)
从设备缓冲区构造新的 source info 对象。
source_info(cudf::io::datasource *source)
为单个用户实现的 source 构造新的 source info 对象。
source_info(std::vector< cudf::io::datasource * > const &sources)
为多个用户实现的 source 构造新的 source info 对象。
source_info(cudf::host_span< cudf::device_span< std::byte const >> device_buffers)
为设备内存中的多个缓冲区构造新的 source info 对象。
auto const & host_buffers() const
获取输入的宿主缓冲区。
auto type() const
获取输入的类型。
source_info(std::string file_path)
为单个文件构造新的 source info 对象。
auto const & user_sources() const
获取输入的的用户 source。
source_info(std::vector< host_buffer > const &host_buffers)
为宿主内存中的多个缓冲区构造新的 source info 对象。