Skip to content

[C++] Add "replace" kernel #26960

@asfimport

Description

@asfimport

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:

PRs and other links:

Note: This issue was originally created as ARROW-11044. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions