You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Eduardo Ponce (Jira)" <ji...@apache.org> on 2021/09/01 01:59:00 UTC

[jira] [Commented] (ARROW-9432) [C++/Python] Add option to Take kernel to interpret negative indices as indexing from the right

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

Eduardo Ponce commented on ARROW-9432:
--------------------------------------

Given that there are multiple kernels that "behave-different-on-negative-indices" and there are different semantics of what a negative index entails, this can be handled by having a utility function with an option to dictate on how to interpret negative indices and always resolve to a set of nonnegative indices. For kernels that have index parameters and where negative indices are meaningful, we could have an option to specify the desired behavior and set the default value based on the language's semantics. These kernels would then resolve the negative indices before processing any data.

The drawback from this approach is having an additional (non-familiar) option for these kernels, so maybe resolving the negative indices in the particular language bindings might be a better choice.

> [C++/Python] Add option to Take kernel to interpret negative indices as indexing from the right
> -----------------------------------------------------------------------------------------------
>
>                 Key: ARROW-9432
>                 URL: https://issues.apache.org/jira/browse/ARROW-9432
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++, Python
>            Reporter: Uwe Korn
>            Priority: Major
>             Fix For: 6.0.0
>
>
> Currently negative integers are explicitly forbidding in the {{Take}} kernel. It would be nice to have the option to treat negative integers as "indices from the right" instead.



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