felipecrv commented on issue #37919:
URL: https://github.com/apache/arrow/issues/37919#issuecomment-1779688950

   > (1) If finalize is destructive, then the caller needs to call clone first 
if he wanted to reuse the kernel
   > (2) If finalize is not destructive, then the caller doesn't need to call 
clone.
   
   What if you always call `Clone` before `Finalize` (when you want to do the 
incremental execution you intend to do) and let the kernel decide how they 
implement `Clone`? If a kernel knows their state is immutable (or some 
structure that supports sub-structural sharing [1]), they can implement `Clone` 
by giving you a shared reference to their internal state. Another possibility 
is copy-on-write: the kernel tracks if `Clone` has been called and when time 
comes for `Finalize` it makes a copy preserving the data that was shared on 
`Clone`.


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