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

Wes McKinney edited comment on ARROW-772 at 1/25/18 10:49 PM:
--------------------------------------------------------------

OK, this is a pretty good sized project. You can start with supporting any 
signed integer indices to start. I suggest using the functor implementation 
approach used with cast since a particular take kernel will depend on 2 types 
(the value type and index type). 

You're also welcome to create sub-JIRAs if you'd like to handle primitive 
arrays, string/binary arrays, and nested arrays in separate patches to keep the 
size of the patches (and number of test cases to write) smaller

Some other notes off the top of my head:

* In some cases, indices may be negative (e.g. {{arr.take([-4, -3, -2, -1, 
0])}} selects the last 5 elements of a NumPy arrays in reverse order), but 
negative indexing could be handled in follow up work

* Out of bounds indices could either yield null in the output array or cause an 
error, eventually we want to support both

* If the indices have a null, so should the output


was (Author: wesmckinn):
OK, this is a pretty good sized project. You can start with supporting any 
signed integer indices to start. I suggest using the functor implementation 
approach used with cast since a particular take kernel will depend on 2 types 
(the value type and index type). 

You're also welcome to create sub-JIRAs if you'd like to handle primitive 
arrays, string/binary arrays, and nested arrays in separate patches to keep the 
size of the patches (and number of test cases to write) smaller

Some other notes off the top of my head:

* In some cases, indices may be negative (e.g. {{arr.take([-4, -3, -2, -1, 
0])}} selects the last 5 elements of a NumPy arrays in reverse order), but 
negative indexing could be handled in follow up work
* Out of bounds indices could either yield null in the output array or cause an 
error, eventually we want to support both
* If the indices have a null, so should the output

> [C++] Implement take kernel functions
> -------------------------------------
>
>                 Key: ARROW-772
>                 URL: https://issues.apache.org/jira/browse/ARROW-772
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++
>            Reporter: Wes McKinney
>            Assignee: Jingyuan Wang
>            Priority: Major
>              Labels: Analytics
>             Fix For: 0.9.0
>
>
> Among other things, this can be used to convert from DictionaryArray back to 
> dense array. This is equivalent to {{ndarray.take}} in NumPy



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to