[
https://issues.apache.org/jira/browse/ARROW-14518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17436549#comment-17436549
]
Kanstantsin Ilchanka commented on ARROW-14518:
----------------------------------------------
Btw it faults on macOS if precision is bigger than max
{code:java}
Arrow::Decimal128DataType.new(50, 48)
/tmp/apache-arrow-20211019-6348-1ltpz75/apache-arrow-5.0.0/cpp/src/arrow/type.cc:813:
Check failed: (precision) <= (kMaxPrecision)
0 libarrow.500.dylib 0x000000011170b8e2
_ZN5arrow4util7CerrLogD2Ev + 204
1 libarrow.500.dylib 0x000000011170b808
_ZN5arrow4util7CerrLogD0Ev + 14
2 libarrow.500.dylib 0x000000011170b7b0
_ZN5arrow4util8ArrowLogD1Ev + 34
3 libarrow.500.dylib 0x00000001116a7eba
_ZN5arrow14Decimal128TypeC2Eii + 176
4 libarrow.500.dylib 0x00000001116b21bc
_ZN5arrow10decimal128Eii + 78
5 libarrow-glib.500.dylib 0x000000011147eb68
garrow_decimal128_data_type_new + 24
6 libffi.8.dylib 0x0000000111122d8a ffi_call_unix64 + 82
7 ??? 0x00007ffee21c3818 0x0 + 140732691920920
{code}
And if invalid decimal passed
{code:java}
Arrow::Decimal128.new('2,2')
/tmp/apache-arrow-20211019-6348-1ltpz75/apache-arrow-5.0.0/cpp/src/arrow/result.cc:28:
ValueOrDie called on an error: Invalid: The string '2,2' is not a valid
decimal number
0 libarrow.500.dylib 0x00000001099718e2
_ZN5arrow4util7CerrLogD2Ev + 204
1 libarrow.500.dylib 0x0000000109971808
_ZN5arrow4util7CerrLogD0Ev + 14
2 libarrow.500.dylib 0x00000001099717b0
_ZN5arrow4util8ArrowLogD1Ev + 34
3 libarrow.500.dylib 0x00000001098c6dcf
_ZN5arrow8internal14DieWithMessageERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
+ 111
4 libarrow.500.dylib 0x00000001098c6e7e
_ZN5arrow8internal17InvalidValueOrDieERKNS_6StatusE + 146
5 libarrow.500.dylib 0x000000010995af91
_ZN5arrow10Decimal128C1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
+ 93
6 libarrow-glib.500.dylib 0x00000001054d73a5
_Z25garrow_decimal_new_stringIN5arrow10Decimal128EEPN16DecimalConverterIT_E10GArrowTypeEPKc
+ 181
7 libffi.8.dylib 0x0000000105166d8a ffi_call_unix64 + 82
8 ??? 0x00007ffeee29b9a8 0x0 + 140732894132648
{code}
> [Ruby] ArrayBuilder doesn't work correctly with Decimal
> -------------------------------------------------------
>
> Key: ARROW-14518
> URL: https://issues.apache.org/jira/browse/ARROW-14518
> Project: Apache Arrow
> Issue Type: Bug
> Components: Ruby
> Reporter: Kanstantsin Ilchanka
> Priority: Minor
>
> When trying to convert raw data with decimal values to Arrow::Table error
> received
>
> {code:java}
> Arrow::Table.new(x: [BigDecimal('1.1')])
> ArgumentError: wrong arguments: Arrow::Decimal128ArrayBuilder#initialize():
> available signatures: (data_type:
> interface(Arrow::Decimal128DataType(GArrowDecimal128DataType)))
> {code}
> I guess this is because Decimal128ArrayBuilder expects Decimal128DataType in
> initialiser, however I'm not sure how to correctly and effectively detect
> precision and scale from array of BigDecimal
>
> {code:java}
> Arrow::VERSION
> => "5.0.0"{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)