ShaiviAgarwal2 commented on issue #39463:
URL: https://github.com/apache/arrow/issues/39463#issuecomment-1882818798

   To enhance the Cast kernel function, we should follow the mentioned steps:-
   
   Firstly, we will identify the location of the Cast kernel function in the 
code.
   Then we will remove the Legacy `CastTo` function from the code.
   Then we will modify the Cast kernel function to handle the conversion of 
`LargeStringType`, `BinaryType`, and `LargeBinaryType` to Dictionary.
   Finally, we will test the updated Cast kernel function
   
   I have created it with a basic example of how this might look in C++ 
   
   ```
   template <typename T>
   Dictionary CastKernel(T input) {
       if (type(input) == type(LargeStringType) || type(input) == 
type(BinaryType) || type(input) == type(LargeBinaryType)) {
           // Convert to Dictionary type
           Dictionary output = convertToDictionary(input);
           return output;
       } else {
           // Leave as is
           return input;
       }
   }
   
   Dictionary convertToDictionary(T input) {
       // rest of the code to convert it
   }
   ```
   
   


-- 
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