fenfeng9 commented on PR #50723:
URL: https://github.com/apache/arrow/pull/50723#issuecomment-5122639223
Here are some examples from a local GDB session.
```cpp
// Scalars
Decimal32Scalar decimal32_scalar_pos{
Decimal32("1234567"), decimal32(9, 4)};
Decimal64Scalar decimal64_scalar_pos{
Decimal64("12345678901234567"), decimal64(18, 4)};
// Arrays
auto heap_decimal32_array =
SliceArrayFromJSON(
decimal32(9, 4),
R"([null, "-12345.6789", "12345.6789"])");
auto heap_decimal64_array =
SliceArrayFromJSON(
decimal64(18, 4),
R"([null, "-12345678901234.5678", "12345678901234.5678"])");
auto heap_decimal32_array_sliced =
heap_decimal32_array->Slice(1, 1);
```
```python
(gdb) p decimal32_scalar_pos
$1 = arrow::Decimal32Scalar of value 123.4567 [precision=9, scale=4]
(gdb) p decimal64_scalar_pos
$2 = arrow::Decimal64Scalar of value 1234567890123.4567 [precision=18,
scale=4]
(gdb) p *heap_decimal32_array
$3 = (std::__shared_ptr_access<arrow::Array, (__gnu_cxx::_Lock_policy)2,
false, false>::element_type &) @0x43aa50:
arrow::Decimal32Array of type arrow::decimal32(9, 4),
length 3, offset 0, null count 1 = {null, -12345.6789, 12345.6789}
(gdb) p *heap_decimal64_array
$4 = (std::__shared_ptr_access<arrow::Array, (__gnu_cxx::_Lock_policy)2,
false, false>::element_type &) @0x43aaa0:
arrow::Decimal64Array of type arrow::decimal64(18, 4),
length 3, offset 0, null count 1 = {null, -12345678901234.5678,
12345678901234.5678}
(gdb) p *heap_decimal32_array_sliced
$5 = (std::__shared_ptr_access<arrow::Array, (__gnu_cxx::_Lock_policy)2,
false, false>::element_type &) @0x43b060:
arrow::Decimal32Array of type arrow::decimal32(9, 4),
length 1, offset 1, unknown null count = {-12345.6789}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]