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

Wes McKinney commented on ARROW-3790:
-------------------------------------

Just added you as a contributor, so you can assign yourself issues now

> [C++] Signed to unsigned integer cast yields incorrect results when type 
> sizes are the same
> -------------------------------------------------------------------------------------------
>
>                 Key: ARROW-3790
>                 URL: https://issues.apache.org/jira/browse/ARROW-3790
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Wes McKinney
>            Assignee: Francois Saint-Jacques
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.12.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In 
> https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernels/cast.cc#L239,
>  an {{int32_t}} is overflows in 
> {code}
> constexpr in_type kMax = 
> static_cast<in_type>(std::numeric_limits<out_type>::max());
> {code}
> resulting in safety checks not being correctly performed
> {code}
> In [2]: arr = pa.array([-1, -2, -3], type='int32')
> In [3]: arr.cast('uint32')
> Out[3]: 
> <pyarrow.lib.UInt32Array object at 0x7f4889457b88>
> [
>   4294967295,
>   4294967294,
>   4294967293
> ]
> {code}
> This would be expected to error when {{safe=True}}



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

Reply via email to