felipecrv commented on PR #41827:
URL: https://github.com/apache/arrow/pull/41827#issuecomment-2161918784

   > For example, the Scalar::ToString function used CastTo(utf8()) to handle 
ToString(), and I thought I could solve this by implementing the Cast Kernel 
for String Type. This is why I attempted to create these kernels.
   
   OK, it's good that there is precedent in the codebase for the string 
conversions to be this way.
   
   > Thank you again for the in-depth review. I feel a bit overwhelmed about 
how to proceed.
   
   I'm sorry. Anything that touches all the Arrow types becomes very 
overwhelming.
   
   And when you're dealing with nested types you move away from the world where 
static dispatching works and you need a way to perform dynamic dispatching 
(either via `switch` on type ids or virtual calls — vtables).
   
   Imagine converting an instance of `list<list<struct<utf8, list<union<int64, 
utf8>>>>>` to string. You need a tree of string formatters prepared before the 
loop and it has to follow the same shape of the `DataType`. Doing it 
value-by-value is just as hard, but slower.
   
   


-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to