GH-50660: [C++][Dev] Add Decimal32 and Decimal64 GDB pretty-printers - #50723
Open
fenfeng9 wants to merge 1 commit into
Open
GH-50660: [C++][Dev] Add Decimal32 and Decimal64 GDB pretty-printers#50723fenfeng9 wants to merge 1 commit into
fenfeng9 wants to merge 1 commit into
Conversation
fenfeng9
force-pushed
the
gh-50660-decimal32-64-gdb
branch
from
July 29, 2026 18:58
21dc913 to
fb4a550
Compare
Member
|
@Reranko05 Do you feel like reviewing this? |
Contributor
Author
|
Here are some examples from a local GDB session. // 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);(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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
The Arrow GDB pretty-printers support
Decimal128andDecimal256, but do not supportDecimal32orDecimal64.What changes are included in this PR?
Decimal32andDecimal64.max_type_idvariable.Are these changes tested?
Yes.
Are there any user-facing changes?
No.
gdb_arrow.py#50660