maropu commented on a change in pull request #31340:
URL: https://github.com/apache/spark/pull/31340#discussion_r566498317



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectAggregationIterator.scala
##########
@@ -76,6 +82,11 @@ class ObjectAggregationIterator(
    */
   processInputs()
 
+  TaskContext.get().addTaskCompletionListener[Unit](_ => {
+    // At the end of the task, update the task's spill size.
+    spillSize.set(TaskContext.get().taskMetrics().memoryBytesSpilled - 
spillSizeBefore)

Review comment:
       Yea, the approach sounds good to me if possible. Anyway, it looks like 
we need to investigate how to estimate the size in a separate ticket.




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



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

Reply via email to