对列表列中每行的列表元素内的元素进行分段聚集。
仅支持任意深度的 source_column
和深度为 1 的 gather_map_list
。
source_column : [{"a", "b", "c", "d"}, {"1", "2", "3", "4"}, {"x", "y", "z"}]
gather_map_list : [{0, 1, 3, 2}, {1, 3, 2}, {}]
结果 : [{"a", "b", "d", "c"}, {"2", "4", "3"}, {}]
- 异常
-
如果 gather_map_list
中的索引超出了范围 [-n, n)
(其中 n
是 source 列对应行中的元素数量),则行为如下:
- 如果
bounds_policy
设置为 DONT_CHECK
,则行为是未定义的。
- 如果
bounds_policy
设置为 NULLIFY
,则输出列中列表行中的相应元素将设置为 null。
source_column : [{"a", "b", "c", "d"}, {"1", "2", "3", "4"}, {"x", "y", "z"}]
gather_map_list : [{0, -1, 4, -5}, {1, 3, 5}, {}]
result_with_nullify : [{"a", "d", null, null}, {"2", "4", null}, {}]
- 参数
-
source_column | 要从中聚集的列表列的视图。 |
gather_map_list | 一个非 null 的整数索引列表列的视图,用于将 source 列中每行的列表元素映射到目标列中的列表行。 |
bounds_policy | 可以是 DONT_CHECK 或 NULLIFY 。当聚集索引超出范围 [-n, n) 时,选择是否将输出列表行的元素设置为 null,其中 n 是 gather-map 行对应的列表行中的元素数量。 |
stream | 用于设备内存操作和内核启动的 CUDA stream。 |
mr | 用于分配任何返回对象的设备内存资源。 |
- 返回值
- 一个列,其行列表中的元素根据
gather_map_list
进行聚集。