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/02 01:54:00 UTC

[jira] [Comment Edited] (ARROW-12657) [C++][Python][Compute] String hex to numeric conversion and bit shifting

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

Eduardo Ponce edited comment on ARROW-12657 at 9/2/21, 1:53 AM:
----------------------------------------------------------------

Based on the different hex formats supported by other tools, I would suggest to support case-insensitive (including '0x') and make it optional. The reason for making it optional is that the function name already states that it is a hex value, so forcing '0x' seems redundant but acceptable.


was (Author: edponce):
Based on the different hex formats supported by other tools, I would suggest to support case-insensitive (including '0x') and make it optional. The reason for making it optional is that the function name already states that it is a hex value, so forcing '0x' is a bit redundant.

> [C++][Python][Compute] String hex to numeric conversion and bit shifting
> ------------------------------------------------------------------------
>
>                 Key: ARROW-12657
>                 URL: https://issues.apache.org/jira/browse/ARROW-12657
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++, Python
>            Reporter: Franz
>            Assignee: William Malpica
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Hi Apache Arrow Community,
> thanks for the great work on this project - it is really a game changer. I've started to use it more frequently since more and more compute kernels became available.
> However, I have a current requirement which I can't fulfill, yet. More concretely, I have hex values as strings. I need to convert them to numeric type (int) and apply bit shifting.
> Currently, I can't find a way to do so. I tried type casts (string to int) like 
> {code:java}
> import pyarrow as pa
> array = pa.array(["0x2001591", "0x2000848", "0x2000123"])
> array.cast(pa.uint32()){code}
> However this results in _ArrowInvalid: Failed to parse string: '0x2000123' as a scalar of type uint32._ 
> Moreover, I will need to apply bit shifting once converted. I'm not sure if there is anything comparable in the compute kernels, yet.
> Thanks for any help in advance.
>  
>  



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