[
https://issues.apache.org/jira/browse/ARROW-1904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285396#comment-16285396
]
ASF GitHub Bot commented on ARROW-1904:
---------------------------------------
wesm opened a new pull request #1409: ARROW-1904: [C++] Deprecate
PrimitiveArray::raw_values
URL: https://github.com/apache/arrow/pull/1409
I was mistaken about this method's handling of the offset parameter, but it
doesn't work correctly for boolean data (also a subclass of `PrimitiveArray`),
so I think it's better to remove this method altogether
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [C++] Using the raw_values() method on arrow::PrimitiveArray yields
> unreliable results on some compilers
> --------------------------------------------------------------------------------------------------------
>
> Key: ARROW-1904
> URL: https://issues.apache.org/jira/browse/ARROW-1904
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Reporter: Wes McKinney
> Assignee: Wes McKinney
> Labels: pull-request-available
> Fix For: 0.8.0
>
>
> I ran into an odd issue where, even though I was casting to
> {{arrow::PrimitiveArray}}, it picked up the {{raw_values}} method from a
> subclass of {{PrimitiveArray}} (which includes a slice offset)
> {code}
> (gdb) p reinterpret_cast<const int64_t*>(reinterpret_cast<const
> PrimitiveArray&>(arr).raw_values())[0]
> $9 = 25
> (gdb) p reinterpret_cast<const int64_t*>(reinterpret_cast<const
> PrimitiveArray&>(arr).raw_values_)[0]
> $10 = 10
> (gdb) p arr.offset()
> $11 = 15
> {code}
> I think the {{raw_values}} method in PrimitiveArray should be deprecated and
> removed, since it is dangerous to use as it does not include a slice offset,
> if any
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)