[ 
https://issues.apache.org/jira/browse/ARROW-9430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17355310#comment-17355310
 ] 

Joris Van den Bossche commented on ARROW-9430:
----------------------------------------------

I am not sure that's the best way to implement it. "if_else" is a scalar kernel 
that works element-wise, where mask/values/array need to have the same length 
(or is a scalar that is broadcasted). While for the setitem operation here, the 
"values" to set (or replace) based on the mask have a different length 
(matching the number of {{true}} values in the mask). In principle we could 
first convert that array to an array of the correctly length, and then use 
"if_else", but not sure how efficient that would be compared to a custom 
implementation.  

> [C++/Python] Kernel for SetItem(BooleanArray, values)
> -----------------------------------------------------
>
>                 Key: ARROW-9430
>                 URL: https://issues.apache.org/jira/browse/ARROW-9430
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++, Python
>            Reporter: Uwe Korn
>            Assignee: David Li
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> We should have a kernel that allows overriding the values of an array by 
> supplying a boolean mask and a scalar or an array of equal length.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to