cloud-fan commented on issue #24149: [SPARK-27207][SQL] : Ensure aggregate 
buffers are initialized again for So…
URL: https://github.com/apache/spark/pull/24149#issuecomment-490191436
 
 
   Each aggregate function will create its own buffer, but the aggregate 
function doesn't hold the buffer, the buffer is managed by Spark. Aggregate 
function should be stateless.
   
   Let's say we have an aggregate expression `expr`. `expr` creates an 
aggregate function `f1` to do the work before sort fallback happens. `f1` 
creates a buffer and starts to accumulate the buffer. When sort fallback 
happens, `expr` creates a new aggregate function `f2`. We still ask `f1` to 
create the buffer, and then `f2` starts working and accumulate the buffer.
   
   Since `f1` and `f2` are the same functions, this should be fine.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to