You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Kouhei Sutou (Jira)" <ji...@apache.org> on 2021/11/01 20:51:00 UTC

[jira] [Commented] (ARROW-14532) [C++] Convert Decimal128 arrays to Decimal256 when we have precision out of range error

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

Kouhei Sutou commented on ARROW-14532:
--------------------------------------

We need to implement this in C++: https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernels/scalar_arithmetic.cc

The Ruby example should work once this is implemented in C++ side.

> [C++] Convert Decimal128 arrays to Decimal256 when we have precision out of range error
> ---------------------------------------------------------------------------------------
>
>                 Key: ARROW-14532
>                 URL: https://issues.apache.org/jira/browse/ARROW-14532
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Kanstantsin Ilchanka
>            Priority: Minor
>
> I'm tried to multiply 2 Decimal128 arrays with max precision(38) and it fails because precision is out of range. I expected that result should be converted to Decimal256 in such case, what do you think?
> {code:java}
> a = Arrow::Decimal128ArrayBuilder.build(
>   Arrow::Decimal128DataType.new(38, 15), [1.1, 2.2, 3.3]
> )
> b = Arrow::Decimal128ArrayBuilder.build(
>   Arrow::Decimal128DataType.new(38, 15), [1.1, 2.2, 3.3]
> )
> Arrow::Function.find('multiply').execute([a, b])
> Arrow::Error::Invalid: [function][execute]: Invalid: Decimal precision out of range: 77
> Arrow::Function.find('add').execute([a, b])
> Arrow::Error::Invalid: [function][execute]: Invalid: Decimal precision out of range: 39{code}



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