GH-48740: [C++] Add missing CTypeTraits for decimal types#48763
GH-48740: [C++] Add missing CTypeTraits for decimal types#48763shubhamkoti wants to merge 5 commits intoapache:mainfrom
Conversation
|
|
|
I think that what you need is |
|
cc @zanmato1984 |
zanmato1984
left a comment
There was a problem hiding this comment.
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, |
|
Hi @zanmato1984 , |
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