You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "shubhamkoti (via GitHub)" <gi...@apache.org> on 2026/01/07 13:28:25 UTC

[PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

shubhamkoti opened a new pull request, #48763:
URL: https://github.com/apache/arrow/pull/48763

   ### Rationale for this change
   As reported in #48740, the `CTypeTraits` specializations were missing for `Decimal128Type` and `Decimal256Type`. This prevented generic code from correctly identifying the C++ types associated with these Arrow types.
   
   ### What changes are included in this PR?
   - Added `CTypeTraits<Decimal128Type>` mapping to `Decimal128`.
   - Added `CTypeTraits<Decimal256Type>` mapping to `Decimal256`.
   
   ### Are these changes tested?
   Yes. I verified the changes locally by running the existing type traits tests.
   Command used: `ctest -R arrow-type-traits`
   
   ### Are there any user-facing changes?
   No.
   
   Closes #48740


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

Posted by "HuaHuaY (via GitHub)" <gi...@apache.org>.
HuaHuaY commented on PR #48763:
URL: https://github.com/apache/arrow/pull/48763#issuecomment-3748982670

   > > I think that what you need is `TypeTraits` but not `CTypeTraits`
   > 
   > Hi @HuaHuaY , this issue is specifically for `CTypeTraits` which are now missing for certain types (mostly Decimals).
   
   Yeah. I found that you opened the issue. But I think that this PR is implementing types' `TypeTraits` instead of `CTypeTraits`. You can check the code around line 354 is similar to this PR.
   ```cpp
   template <>
   struct TypeTraits<Decimal128Type> {
     using ArrayType = Decimal128Array;
     using BuilderType = Decimal128Builder;
     using ScalarType = Decimal128Scalar;
     using CType = Decimal128;
     constexpr static bool is_parameter_free = false;
   };
   
   template <>
   struct TypeTraits<Decimal256Type> {
     using ArrayType = Decimal256Array;
     using BuilderType = Decimal256Builder;
     using ScalarType = Decimal256Scalar;
     using CType = Decimal256;
     constexpr static bool is_parameter_free = false;
   };
   ```
   I guess that there should not be `CType` in `CTypeTraits` and we may need these code instead:
   ```cpp
   template <>
   struct CTypeTraits<Decimal128Type::CType> {
     using ArrowType = Decimal128Type;
   };
   
   template <>
   struct CTypeTraits<Decimal256Type::CType> {
     using ArrowType = Decimal256Type;
   };
   ```
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

Posted by "HuaHuaY (via GitHub)" <gi...@apache.org>.
HuaHuaY commented on PR #48763:
URL: https://github.com/apache/arrow/pull/48763#issuecomment-3749016931

   I found that my understanding of this code isn't complete either. Referring to other implementations, `CTypeTraits` should inherit from `TypeTraits`.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

Posted by "HuaHuaY (via GitHub)" <gi...@apache.org>.
HuaHuaY commented on PR #48763:
URL: https://github.com/apache/arrow/pull/48763#issuecomment-3727554828

   I think that what you need is `TypeTraits` but not `CTypeTraits`


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on PR #48763:
URL: https://github.com/apache/arrow/pull/48763#issuecomment-3748779313

   > I think that what you need is `TypeTraits` but not `CTypeTraits`
   
   Hi @HuaHuaY , this issue is specifically for `CTypeTraits` which are now missing for certain types (mostly Decimals).


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #48763:
URL: https://github.com/apache/arrow/pull/48763#issuecomment-3739608087

   cc @zanmato1984 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #48763:
URL: https://github.com/apache/arrow/pull/48763#issuecomment-3718894147

   :warning: GitHub issue #48740 **has been automatically assigned in GitHub** to PR creator.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-48740: [C++] Add missing CTypeTraits for decimal types [arrow]

Posted by "shubhamkoti (via GitHub)" <gi...@apache.org>.
shubhamkoti commented on PR #48763:
URL: https://github.com/apache/arrow/pull/48763#issuecomment-3777599963

   Hi  @zanmato1984 ,
   could you please approve the pending GitHub Actions workflows for this PR?
   I’ve updated the PR to include Decimal32/64 in addition to Decimal128/256.
   Thanks!


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org