-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-48740: [C++] Add missing CTypeTraits for decimal types #48763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
|
I think that what you need is |
|
cc @zanmato1984 |
zanmato1984
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also want to do for Decimal32/64 as well.
Hi @HuaHuaY , this issue is specifically for |
But I think that this PR is implementing types' // line 354
template <>
struct TypeTraits<Decimal128Type> {
...
using CType = Decimal128;
...
};
template <>
struct TypeTraits<Decimal256Type> {
...
using CType = Decimal256;
...
};
// this PR
template <>
struct CTypeTraits<Decimal128Type> {
using ArrowType = Decimal128Type;
using CType = Decimal128;
};
template <>
struct CTypeTraits<Decimal256Type> {
using ArrowType = Decimal256Type;
using CType = Decimal256;
};I guess that there should not be template <>
struct CTypeTraits<Decimal128Type::CType> {
using ArrowType = Decimal128Type;
};
template <>
struct CTypeTraits<Decimal256Type::CType> {
using ArrowType = Decimal256Type;
}; |
I found that my understanding of this code isn't complete either. Referring to other implementations, |
Rationale for this change
As reported in #48740, the
CTypeTraitsspecializations were missing forDecimal128TypeandDecimal256Type. This prevented generic code from correctly identifying the C++ types associated with these Arrow types.What changes are included in this PR?
CTypeTraits<Decimal128Type>mapping toDecimal128.CTypeTraits<Decimal256Type>mapping toDecimal256.Are these changes tested?
Yes. I verified the changes locally by running the existing type traits tests.
Command used:
ctest -R arrow-type-traitsAre there any user-facing changes?
No.
Closes #48740