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/10/21 15:25:00 UTC

[jira] [Commented] (ARROW-14110) [C++] Decimal promotion rules should consider inflating type

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

David Li commented on ARROW-14110:
----------------------------------

See ML discussion at [https://lists.apache.org/thread.html/r8cc9d7af40351b1f172c5b71b605aae8d8168b6910bc5d797a5387a6%40%3Cdev.arrow.apache.org%3E].

Some notes:
 *  [SQL Server|https://docs.microsoft.com/en-us/sql/t-sql/data-types/precision-scale-and-length-transact-sql?view=sql-server-ver15] not only saturates at max precision, but can also reduce scale to try to accomodate.
 * Other types do not promote to wider types automatically, so decimal may be an exception in this regard.
 * We may add options for different such behaviors as needed.

> [C++] Decimal promotion rules should consider inflating type
> ------------------------------------------------------------
>
>                 Key: ARROW-14110
>                 URL: https://issues.apache.org/jira/browse/ARROW-14110
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Weston Pace
>            Priority: Major
>              Labels: kernel
>
> I'm not sure how strongly I feel about this but, for example:
> {code:python}
> Decimal(20, 4) / Decimal(20, 4) => Decimal(41, 21)
> {code}
> Decimal(20, 4) is in range for 128 but Decimal(41, 21) is out of range for 128 (but in range for 256).
> Currently calling divide with two 128 bit decimals will fail but it could promote to a decimal 256.



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