You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Bruno LE HYARIC (Jira)" <ji...@apache.org> on 2021/01/05 17:31:00 UTC
[jira] [Updated] (ARROW-11044) [C++] Add "replace" kernel
[ https://issues.apache.org/jira/browse/ARROW-11044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bruno LE HYARIC updated ARROW-11044:
------------------------------------
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](https://issues.apache.org/jira/browse/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).
was:
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|https://github.com/jorisvandenbossche]). The implementation is inspired by "fill_null" kernel except it takes an additional BooleanArray parameter which is used as a mask to trigger value replacement.
With following "null handling" logic:
{noformat}
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
{noformat}
(each column indicates the validity bit and the corresponding value. "v" for current value, "r" for replacement value).
> [C++] Add "replace" kernel
> --------------------------
>
> Key: ARROW-11044
> URL: https://issues.apache.org/jira/browse/ARROW-11044
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++
> Reporter: Bruno LE HYARIC
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> 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](https://issues.apache.org/jira/browse/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).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)