-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
Purpose a "replace" compute kernel which could fulfil -ARROW-10641 - [C++] A "replace" or "map" kernel to replace values in array based on mapping (@jorisvandenbossche)- ARROW-9430 - [C++/Python] Kernel for SetItem(BooleanArray, values) (@xhochy). The implementation started on the basis of "fill_null" kernel. But it takes an additional BooleanArray parameter which is used as a mask to trigger value replacement.
With following "null handling" logic:
Values Mask Replacement Output
1 v 1 false 1 r 1 v
1 v 1 true 1 r 1 r
1 v 0 null 1 r 1 v
1 v 1 false 0 null 1 v
1 v 1 true 0 null 1 v
1 v 0 null 0 null 1 v
0 null 1 false 1 r 0 null
0 null 1 true 1 r 1 r
0 null 0 null 1 r 0 null
0 null 1 false 0 null 0 null
0 null 1 true 0 null 0 null
0 null 0 null 0 null 0 null
(each column indicates the validity bit and the corresponding value. "v" for current value, "r" for replacement value).
Reporter: Bruno LE HYARIC / @bu2
Related issues:
- [C++/Python] Kernel for SetItem(IntegerArray, values) (relates to)
- [C++] A "replace" or "map" kernel to replace values in array based on mapping (relates to)
- [C++/Python] Kernel for SetItem(BooleanArray, values) (relates to)
- [C++] An "if_else" kernel to combine two arrays based on a mask (relates to)
- [C++] An "if_else" kernel to combine two arrays based on a mask (is superceded by)
PRs and other links:
Note: This issue was originally created as ARROW-11044. Please see the migration documentation for further details.