Skip to content

GH-48740: [C++] Add missing CTypeTraits for decimal types#50153

Open
Naurder wants to merge 2 commits into
apache:mainfrom
Naurder:GH-48740-ctype-traits
Open

GH-48740: [C++] Add missing CTypeTraits for decimal types#50153
Naurder wants to merge 2 commits into
apache:mainfrom
Naurder:GH-48740-ctype-traits

Conversation

@Naurder

@Naurder Naurder commented Jun 10, 2026

Copy link
Copy Markdown

Rationale for this change

As reported in #48740, the CTypeTraits specializations were missing for decimal types. This prevented generic code from correctly mapping C++ decimal types to Arrow types.

What changes are included in this PR?

  • Added CTypeTraits<Decimal128> mapping to Decimal128Type.
  • Added CTypeTraits<Decimal256> mapping to Decimal256Type.

Are these changes tested?

Yes, via existing type traits tests in the CI pipeline.

Are there any user-facing changes?

No.

Closes #48740

@Naurder

Naurder commented Jun 10, 2026

Copy link
Copy Markdown
Author

Hi @HuaHuaY and @zanmato1984,
I picked up this issue and implemented the fix exactly as discussed in the closed PR #48763. Could you please take a look when you have a chance? Thanks!

Comment thread cpp/src/arrow/type_traits.h Outdated
/// \addtogroup type-traits
/// @{
template <>
struct CTypeTraits<Decimal128> {

@HuaHuaY HuaHuaY Jun 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should inherit TypeTraits<Decimal128Type> like other specialization.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thank you very much for suggestion.

@Naurder Naurder requested a review from pitrou as a code owner June 11, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] Some CTypeTraits are missing

2 participants