andishgar commented on issue #50080:
URL: https://github.com/apache/arrow/issues/50080#issuecomment-4607979043

   @pitrous, for the below code:
   
   
https://github.com/apache/arrow/blob/73742e82ed771cb7df40789882e220118045123b/cpp/src/arrow/compute/kernels/scalar_cast_string.cc#L772-L780
   
   I made these changes and I pass all tests except [this 
one](https://github.com/apache/arrow/blob/3346132f1339b579c9bbbc826ba56b6d37ce4722/cpp/src/arrow/compute/kernels/scalar_cast_test.cc#L163-L245),
 which is resolvable. (I'm aware that I should make some changes in the kernel 
too; the change below is just for prototyping.)
   
   ```cpp
   void AddBinaryToBinaryCast(CastFunction* func) {
     if constexpr (!std::is_same_v<OutType, StringType>) {
       AddBinaryToBinaryCast<OutType, StringType>(func);
     }
     if constexpr (!std::is_same_v<OutType, StringViewType>) {
       AddBinaryToBinaryCast<OutType, StringViewType>(func);
     }
     if constexpr (!std::is_same_v<OutType, BinaryType>) {
       AddBinaryToBinaryCast<OutType, BinaryType>(func);
     }
     if constexpr (!std::is_same_v<OutType, BinaryViewType>) {
       AddBinaryToBinaryCast<OutType, BinaryViewType>(func);
     }
     if constexpr (!std::is_same_v<OutType, LargeStringType>) {
       AddBinaryToBinaryCast<OutType, LargeStringType>(func);
     }
     if constexpr (!std::is_same_v<OutType, LargeBinaryType>) {
       AddBinaryToBinaryCast<OutType, LargeBinaryType>(func);
     }
     if constexpr (!std::is_same_v<OutType, FixedSizeBinaryType>) {
       AddBinaryToBinaryCast<OutType, FixedSizeBinaryType>(func);
     }
   }
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to