复制收集#
- group copy_gather
函数
-
std::unique_ptr<table> gather(table_view const &source_table, column_view const &gather_map, out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())#
收集指定列的一组行(包括空值)。
根据
gather_map收集源列的行,使得结果表的列中的行“i”将包含来自源列的行“gather_map[i]”。结果表中的行数将等于gather_map中的元素数量。在
gather_map中的负值i被解释为i+n,其中n是source_table中的行数。对于字典列,如果收集结果导致废弃的关键元素,则键列组件会被复制而不会被修剪。
- Throws:
std::invalid_argument – 如果 gather_map 包含空值。
- Parameters:
source_table – 输入列,其行将被收集
gather_map – 查看一个非空整型索引列,该列将源列中的行映射到目标列中的行。
bounds_policy – 用于处理可能的越界索引的策略
DONT_CHECK跳过所有对gather map值的边界检查。NULLIFY将gather map中越界索引对应的行强制转换为空元素。调用者应在确定gather_map仅包含有效索引时使用DONT_CHECK以获得更好的性能。如果policy设置为DONT_CHECK并且gather map中存在越界索引,则行为未定义。默认为DONT_CHECK。stream – 用于设备内存操作和内核启动的CUDA流
mr – 用于分配返回表的设备内存的设备内存资源
- Returns:
收集的结果
-
std::unique_ptr<table> gather(table_view const &source_table, column_view const &gather_map, out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())#