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

[jira] [Commented] (ARROW-13617) [C++] Make Decimal representations consistent

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

David Li commented on ARROW-13617:
----------------------------------

Another reason why this would be good: nominally Decimal is the same as FixedSizeBinary, however, in compute kernels, currently they need separate handling because their scalar representations are different (Decimal vs Buffer). You could imagine trying to work with all these types via util::string_view or const uint8_t*, however, the representation for BasicDecimal128 makes this hard; there is no native-endian representation that we can just create a pointer to. (Well, the fields in BasicDecimal128 are in native-endian order so you can reinterpret_cast a pointer to the right field, but it would be a little cleaner to have both implementations of native_endian_array() return a std::array& instead of a std::array).

> [C++] Make Decimal representations consistent
> ---------------------------------------------
>
>                 Key: ARROW-13617
>                 URL: https://issues.apache.org/jira/browse/ARROW-13617
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: David Li
>            Priority: Major
>
> Right now Decimal128 is represented as two 64-bit integers (in native endian order) and Decimal256 is represented as a std::array (in native endian order). We could make these consistent (presumably there should be no performance impact). It may also make it easier to extract a common base class or other niceties.



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