Jefffrey opened a new issue, #20087:
URL: https://github.com/apache/datafusion/issues/20087

   ### Is your feature request related to a problem or challenge?
   
   Accumulators (of aggregate functions) can be used in window functions, even 
if the aggregate function doesn't support sliding accumulators; see this issue:
   
   - https://github.com/apache/datafusion/issues/19612
   
   This forces accumulators to _not_ consume their internal state during 
`evaluate()`, which can lead to clones. For example, see `StringAgg`:
   
   
https://github.com/apache/datafusion/blob/a02e6836e7d449008eef592b177ea282595e027a/datafusion/functions-aggregate/src/string_agg.rs#L386-L394
   
   Previously we'd be able to `std::mem::take` the string, but because of the 
above issue we need to clone it for correctness.
   
   ### Describe the solution you'd like
   
   Can accumulators know when they are used in windows, which means they'd have 
to preserve their internal state, vs being used in regular aggregation where 
they can consume their internal state for potential optimization?
   
   ### Describe alternatives you've considered
   
   Maybe not worth doing if the clone would have minimal performance impact?
   
   Also maybe not an issue if we proceed with this issue:
   
   - https://github.com/apache/datafusion/issues/5948
   
   ### Additional context
   
   _No response_


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to